/**
 * TalentorX Public Styles
 *
 * @package TalentorX
 * @since 3.0.0
 */

/* ============================================================
   CSS CUSTOM PROPERTIES
   Scoped to :root so they are available everywhere but do not
   override theme variables (all names are prefixed --tx-pub-*).
   ============================================================ */
:root {
    --tx-pub-primary:     #2563eb;
    --tx-pub-secondary:   #64748b;
    --tx-pub-success:     #10b981;
    --tx-pub-danger:      #ef4444;
    --tx-pub-warning:     #f59e0b;
    --tx-pub-dark:        #1e293b;
    --tx-pub-light:       #f8fafc;
    --tx-pub-border:      #e2e8f0;
    --tx-pub-text:        #334155;
}

/* ============================================================
   SCOPED RESET
   Applied only inside TalentorX-owned app contexts.
   The old global * {} reset has been removed — it was nuking
   theme spacing on every WordPress page where public.css loaded.
   ============================================================ */
.tx-dashboard *,
.tx-auth-panel *,
.talentorx-auth-container *,
.talentorx-standalone-page .tx-dashboard * {
    box-sizing: border-box;
}

/* ============================================================
   APP BODY — STANDALONE PAGES
   Targets the body class set by all TalentorX standalone shells
   (controller path: talentorx-dashboard-page,
    shortcode/template path: talentorx-standalone-page).
   The old body.talentorx-dashboard selector was dead — it never
   matched any body class actually set by the plugin.
   ============================================================ */
body.talentorx-dashboard-page,
body.talentorx-standalone-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--tx-pub-text);
    background: var(--tx-pub-light);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* ============================================================
   AUTH PANEL — UNIFIED DESIGN
   .tx-auth-panel is the root for the unified auth panel.
   All selectors below are scoped to it.
   ============================================================ */
.tx-auth-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #0d2d5e 50%, #0f172a 100%);
    padding: 24px;
    box-sizing: border-box;
}

.tx-auth-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    animation: tx-auth-slide-up 0.3s ease;
    box-sizing: border-box;
}

@keyframes tx-auth-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tx-auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.tx-auth-logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #0066FF, #0052CC);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
}

.tx-auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}

.tx-auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Tab switcher */
.tx-auth-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.tx-auth-tab {
    flex: 1;
    padding: 9px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
    font-family: inherit;
}

.tx-auth-tab.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Form inputs — scoped to .tx-auth-form */
.tx-auth-form .talentorx-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.tx-auth-form .talentorx-input,
.tx-auth-form select {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    background: #fafafa;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.tx-auth-form .talentorx-input:focus,
.tx-auth-form select:focus {
    border-color: #0066FF;
    box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
    background: #fff;
    outline: none;
}

/* Submit button — scoped to .tx-auth-form */
.tx-auth-form .talentorx-btn-primary {
    background: linear-gradient(135deg, #0066FF, #0052CC);
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: all 150ms ease;
    box-shadow: 0 2px 8px rgba(0,102,255,0.3);
    color: #fff;
    border: none;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.tx-auth-form .talentorx-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,102,255,0.4);
}

/* Error/success messages — scoped to .tx-auth-form */
.tx-auth-form .talentorx-message {
    border-radius: 8px;
    font-size: 13px;
    padding: 10px 14px;
}

/* Auth links — scoped to .tx-auth-form */
.tx-auth-form .talentorx-auth-links {
    margin-top: 16px;
    font-size: 13px;
}

/* ============================================================
   LEGACY AUTH CLASSES
   Used in: login-form-v2.php, forgot-password-form.php,
   reset-password-form.php, register-form.php.
   These are scoped to their container so they do not bleed
   into theme pages.
   ============================================================ */
.talentorx-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #0d2d5e 50%, #0f172a 100%);
    padding: 20px;
    box-sizing: border-box;
}

.talentorx-auth-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
}

.talentorx-auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.talentorx-auth-header h2 {
    font-size: 28px;
    color: var(--tx-pub-dark);
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.2;
}

.talentorx-auth-header p {
    color: var(--tx-pub-secondary);
    font-size: 14px;
    margin: 0;
}

.talentorx-form-group {
    margin-bottom: 20px;
}

.talentorx-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--tx-pub-dark);
    font-size: 14px;
}

.talentorx-input,
.talentorx-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--tx-pub-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.talentorx-input:focus,
.talentorx-form select:focus {
    outline: none;
    border-color: var(--tx-pub-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.talentorx-form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--tx-pub-secondary);
}

.talentorx-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.talentorx-btn-primary {
    background: var(--tx-pub-primary);
    color: white;
    width: 100%;
    justify-content: center;
}

.talentorx-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.talentorx-btn-secondary {
    background: var(--tx-pub-secondary);
    color: white;
}

.talentorx-btn-secondary:hover {
    background: #475569;
}

.talentorx-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.talentorx-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.talentorx-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.talentorx-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.talentorx-auth-links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.talentorx-auth-links a {
    color: var(--tx-pub-primary);
    text-decoration: none;
    font-size: 14px;
}

.talentorx-auth-links a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .tx-auth-box,
    .talentorx-auth-box {
        padding: 28px 20px;
    }
}

/* ============================================================
   PHASE 4.0 - PREMIUM SAAS AUTH POLISH (SAFE OVERRIDES)
   Scope: TalentorX standalone/auth/status surfaces only.
   ============================================================ */
:root {
    --tx-saas-primary:        #2563eb;
    --tx-saas-primary-strong: #1d4ed8;
    --tx-saas-accent:         #4f46e5;
    --tx-saas-bg-top:         #eef4ff;
    --tx-saas-bg-mid:         #f5f7ff;
    --tx-saas-bg-base:        #f7f9ff;
    --tx-saas-surface:        rgba(255, 255, 255, 0.94);
    --tx-saas-surface-strong: #ffffff;
    --tx-saas-border:         #dbe5ff;
    --tx-saas-shadow:         0 22px 52px rgba(37, 99, 235, 0.15);
    --tx-saas-shadow-soft:    0 8px 24px rgba(79, 70, 229, 0.08);
    --tx-saas-text:           #0f172a;
    --tx-saas-text-muted:     #64748b;
    --tx-saas-radius-lg:      22px;
    --tx-saas-radius-md:      14px;
    --tx-saas-radius-sm:      10px;
}

body.talentorx-standalone-page,
body.talentorx-dashboard-page {
    background:
        radial-gradient(900px 520px at 12% -14%, rgba(79, 70, 229, 0.15) 0%, rgba(79, 70, 229, 0) 62%),
        radial-gradient(820px 420px at 90% 4%, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0) 60%),
        linear-gradient(180deg, var(--tx-saas-bg-top) 0%, var(--tx-saas-bg-mid) 48%, var(--tx-saas-bg-base) 100%);
    color: var(--tx-saas-text);
}

body.talentorx-standalone-page .tx-auth-panel,
body.talentorx-standalone-page .talentorx-auth-container,
body.talentorx-dashboard-page .tx-auth-panel,
body.talentorx-dashboard-page .talentorx-auth-container {
    min-height: 100vh;
    background: transparent;
    padding: clamp(20px, 4vw, 40px);
    position: relative;
}

body.talentorx-standalone-page .tx-auth-box,
body.talentorx-standalone-page .talentorx-auth-box,
body.talentorx-dashboard-page .tx-auth-box,
body.talentorx-dashboard-page .talentorx-auth-box,
body.talentorx-standalone-page .auth-container,
body.talentorx-dashboard-page .auth-container,
body .tx-shell,
body .tx-reset-shell,
body .tx-status-card {
    border: 1px solid rgba(219, 229, 255, 0.92);
    border-radius: var(--tx-saas-radius-lg);
    background: var(--tx-saas-surface);
    box-shadow: var(--tx-saas-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body .tx-shell,
body .tx-reset-shell,
body .tx-status-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(203, 213, 255, 0.75);
}

body.talentorx-standalone-page .talentorx-auth-header h2,
body.talentorx-standalone-page .tx-auth-title,
body.talentorx-standalone-page .step-title,
body.talentorx-dashboard-page .talentorx-auth-header h2,
body.talentorx-dashboard-page .tx-auth-title,
body.talentorx-dashboard-page .step-title {
    color: #0b132a;
    letter-spacing: -0.02em;
}

body.talentorx-standalone-page .talentorx-auth-header p,
body.talentorx-standalone-page .tx-auth-subtitle,
body.talentorx-standalone-page .step-subtitle,
body.talentorx-dashboard-page .talentorx-auth-header p,
body.talentorx-dashboard-page .tx-auth-subtitle,
body.talentorx-dashboard-page .step-subtitle,
body .tx-shell p,
body .tx-reset-shell p,
body .tx-status-card p {
    color: var(--tx-saas-text-muted);
}

body.talentorx-standalone-page .tx-auth-tabs,
body.talentorx-dashboard-page .tx-auth-tabs,
body.talentorx-standalone-page .mode-toggle,
body.talentorx-dashboard-page .mode-toggle,
body.talentorx-standalone-page .role-tabs,
body.talentorx-dashboard-page .role-tabs {
    border: 1px solid rgba(203, 213, 255, 0.9);
    background: linear-gradient(180deg, #f8faff 0%, #f3f6ff 100%);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.talentorx-standalone-page .tx-auth-tab.active,
body.talentorx-dashboard-page .tx-auth-tab.active,
body.talentorx-standalone-page .mode-btn.active,
body.talentorx-dashboard-page .mode-btn.active,
body.talentorx-standalone-page .role-tab.active,
body.talentorx-dashboard-page .role-tab.active {
    color: #1d4ed8;
    border: 1px solid rgba(191, 208, 255, 0.95);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

body.talentorx-standalone-page .talentorx-form-group label,
body.talentorx-standalone-page .tx-auth-form .talentorx-form-group label,
body.talentorx-dashboard-page .talentorx-form-group label,
body.talentorx-dashboard-page .tx-auth-form .talentorx-form-group label {
    color: #1f2a44;
    font-weight: 600;
}

body.talentorx-standalone-page .talentorx-input,
body.talentorx-standalone-page .tx-auth-form select,
body.talentorx-standalone-page .form-input,
body.talentorx-dashboard-page .talentorx-input,
body.talentorx-dashboard-page .tx-auth-form select,
body.talentorx-dashboard-page .form-input,
body .tx-shell input,
body .tx-reset-shell input,
body .tx-resend input {
    border: 1px solid #cbd7ff;
    border-radius: var(--tx-saas-radius-sm);
    background: #fbfcff;
    color: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

body.talentorx-standalone-page .talentorx-input:focus,
body.talentorx-standalone-page .tx-auth-form select:focus,
body.talentorx-standalone-page .form-input:focus,
body.talentorx-dashboard-page .talentorx-input:focus,
body.talentorx-dashboard-page .tx-auth-form select:focus,
body.talentorx-dashboard-page .form-input:focus,
body .tx-shell input:focus,
body .tx-reset-shell input:focus,
body .tx-resend input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
    outline: none;
}

body.talentorx-standalone-page .talentorx-btn,
body.talentorx-standalone-page .submit-btn,
body.talentorx-dashboard-page .talentorx-btn,
body.talentorx-dashboard-page .submit-btn,
body .tx-btn,
body .tx-status-btn,
body .tx-status-btn-secondary {
    border-radius: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

body.talentorx-standalone-page .talentorx-btn-primary,
body.talentorx-standalone-page .submit-btn,
body.talentorx-dashboard-page .talentorx-btn-primary,
body.talentorx-dashboard-page .submit-btn,
body .tx-btn,
body .tx-status-btn {
    background: linear-gradient(135deg, var(--tx-saas-primary) 0%, var(--tx-saas-accent) 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.23);
}

body.talentorx-standalone-page .talentorx-btn-primary:hover,
body.talentorx-standalone-page .submit-btn:hover,
body.talentorx-dashboard-page .talentorx-btn-primary:hover,
body.talentorx-dashboard-page .submit-btn:hover,
body .tx-btn:hover,
body .tx-status-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

body .tx-btn-secondary,
body .tx-btn-secondary:hover,
body .tx-status-btn-secondary {
    background: #eff4ff;
    color: #1d4ed8;
    border: 1px solid #c9d6ff;
    box-shadow: none;
}

body.talentorx-standalone-page .talentorx-message,
body.talentorx-standalone-page .error-message,
body.talentorx-standalone-page .success-message,
body.talentorx-dashboard-page .talentorx-message,
body.talentorx-dashboard-page .error-message,
body.talentorx-dashboard-page .success-message,
body .tx-message,
body .tx-feedback {
    border-radius: 12px;
    border-width: 1px;
    border-style: solid;
}

body.talentorx-standalone-page .talentorx-auth-links a,
body.talentorx-dashboard-page .talentorx-auth-links a,
body .tx-link-btn {
    color: #335cd6;
    font-weight: 600;
}

body.talentorx-standalone-page .talentorx-auth-links a:hover,
body.talentorx-dashboard-page .talentorx-auth-links a:hover,
body .tx-link-btn:hover {
    color: #1d4ed8;
}

body.talentorx-standalone-page .auth-container,
body.talentorx-dashboard-page .auth-container {
    max-width: 560px;
}

body.talentorx-standalone-page .auth-header,
body.talentorx-dashboard-page .auth-header {
    background: linear-gradient(135deg, #235be7 0%, #4f46e5 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

body.talentorx-standalone-page .role-card,
body.talentorx-dashboard-page .role-card {
    border-radius: 12px;
    border-color: #d4ddff;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

body.talentorx-standalone-page .role-card:hover,
body.talentorx-dashboard-page .role-card:hover,
body.talentorx-standalone-page .role-card.selected,
body.talentorx-dashboard-page .role-card.selected {
    border-color: #9fb5ff;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.17);
}

@media (max-width: 640px) {
    body.talentorx-standalone-page .tx-auth-panel,
    body.talentorx-standalone-page .talentorx-auth-container,
    body.talentorx-dashboard-page .tx-auth-panel,
    body.talentorx-dashboard-page .talentorx-auth-container {
        padding: 16px;
    }
}

/* ============================================================
   PHASE 4.3 - AUTH VERTICAL RHYTHM HOTFIX
   Keeps unified auth card compact and prevents oversized empty area.
   ============================================================ */
body.talentorx-standalone-page.talentorx-auth-standalone,
body.talentorx-dashboard-page.talentorx-auth-standalone {
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(20px, 3.5vw, 42px);
    padding-bottom: 24px;
}

body.talentorx-standalone-page .auth-container,
body.talentorx-dashboard-page .auth-container {
    min-height: 0;
    width: min(560px, 100%);
    margin: 0 auto;
}
