/* ═══════════════════════════════════════════════════
   AUTH.CSS — Premium White & Blue Auth Design System
   SunCare Global — Member Portal
   ═══════════════════════════════════════════════════ */

/* ─── CSS Variables / Design Tokens ─── */
:root {
    --bg-primary: #f0f5ff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-surface: #f4f7fc;
    --border-subtle: #dce5f3;
    --border-active: #a8c4f0;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --gold-main: #d4a843;
    --gold-hover: #b8912e;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --shadow-soft: 0 4px 24px rgba(37, 99, 235, 0.06);
    --shadow-card: 0 12px 40px rgba(37, 99, 235, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 16px 48px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-input-focus: 0 0 0 3px rgba(37, 99, 235, 0.12);
    --gradient-blue: linear-gradient(135deg, #3b82f6, #2563eb, #1d4ed8);
    --gradient-blue-light: linear-gradient(135deg, #60a5fa, #3b82f6);
    --gradient-shine: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* ─── Reset ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Typography ─── */
html,
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    position: relative;
}

/* ─── Subtle Grid Background ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 0;
    pointer-events: none;
}

/* ─── Background Glow Orbs ─── */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: orbFloat1 14s ease-in-out infinite;
}

.bg-orb-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    bottom: -120px;
    left: -120px;
    animation: orbFloat2 18s ease-in-out infinite;
}

@keyframes orbFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-40px, 40px) scale(1.05);
    }
}

@keyframes orbFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.03);
    }
}

/* ─── Top Loader Bar ─── */
.top-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    z-index: 9999;
    background: rgba(37, 99, 235, 0.08);
    overflow: hidden;
}

.top-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 40%;
    height: 100%;
    background: var(--gradient-blue);
    animation: loaderSlide 1.8s infinite ease-in-out;
}

@keyframes loaderSlide {
    0% {
        left: -60%;
    }

    100% {
        left: 120%;
    }
}

/* ─── Page Wrapper ─── */
.page-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════
   TOP NAVIGATION BAR (TradingView-style)
   ═══════════════════════════════════════ */
.tv-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tv-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.tv-header-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.tv-header-logo span {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.tv-header-logo span em {
    font-style: normal;
    color: var(--blue-600);
}

.tv-header-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--blue-600);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--blue-50);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--blue-100);
}

/* ─── Spacing for fixed header ─── */
body.has-header {
    padding-top: 80px;
}

/* ═══════════════════════════════════
   AUTH CARD — Main Container
   ═══════════════════════════════════ */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: 2.5rem 2rem;
    position: relative;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    animation: cardFadeIn 0.6s ease-out;
}

.auth-card:hover {
    box-shadow: var(--shadow-card-hover);
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card.wide {
    max-width: 560px;
}

.auth-card.full-wide {
    max-width: 600px;
}

/* ─── Top accent line ─── */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-blue);
    border-radius: 3px 3px 0 0;
}

/* ─── Shimmer animation on card ─── */
.auth-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 3px;
    background: var(--gradient-shine);
    animation: shimmerLine 4s infinite ease-in-out;
}

@keyframes shimmerLine {
    0% {
        left: -60%;
    }

    100% {
        left: 120%;
    }
}

/* ═══════════════════════════════
   LOGO BLOCK
   ═══════════════════════════════ */
.logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.logo-img-wrap {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--blue-50), #ffffff);
    border: 2px solid var(--blue-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-img-wrap:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.15);
}

.logo-img-wrap img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.logo-brand-name {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-brand-name span {
    color: var(--blue-600);
}

.logo-tagline {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.5;
}

/* ═══════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════ */

/* ─── Section Divider ─── */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0;
}

.section-divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.section-divider p {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--blue-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ─── Form Group ─── */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    padding-left: 2px;
    transition: color 0.25s ease;
}

.form-label .required-star {
    color: var(--accent-red);
}

.form-group:focus-within .form-label {
    color: var(--blue-600);
}

/* ─── Input Wrap ─── */
.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    pointer-events: none;
    transition: color 0.25s ease;
}

.form-group:focus-within .input-icon {
    color: var(--blue-500);
}

/* ─── Text Input ─── */
.form-input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 42px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
    -webkit-appearance: none;
}

.form-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

.form-input:hover {
    border-color: var(--border-active);
}

.form-input:focus {
    border-color: var(--blue-500);
    background: #ffffff;
    box-shadow: var(--shadow-input-focus);
}

.form-input[readonly] {
    color: var(--accent-green);
    font-weight: 600;
    cursor: not-allowed;
    background: var(--bg-surface);
}

/* ═══════════════════════════════
   SUBMIT BUTTON — Primary CTA
   ═══════════════════════════════ */
.btn-primary {
    width: 100%;
    height: 52px;
    background: var(--gradient-blue);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    margin-top: 1.25rem;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary svg,
.btn-primary i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ═══════════════════════════════
   AUTH FOOTER LINKS
   ═══════════════════════════════ */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.84rem;
    color: var(--text-muted);
    font-weight: 500;
}

.auth-footer a {
    color: var(--blue-600);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.25s ease;
    border-bottom: 1px solid transparent;
}

.auth-footer a:hover {
    color: var(--blue-500);
    border-bottom-color: var(--blue-300);
}

/* ═══════════════════════════════
   ALERT / NOTIFICATION BOXES
   ═══════════════════════════════ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.alert-success {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #15803d;
}

.alert svg,
.alert i {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* ═══════════════════════════════
   FORM — LABEL ROW (with forgot link)
   ═══════════════════════════════ */
.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-left: 2px;
}

.label-row .form-label {
    margin-bottom: 0;
}

.label-link {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--blue-600);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.25s ease;
}

.label-link:hover {
    color: var(--blue-500);
}

/* ═══════════════════════════════
   PHONE ROW + SELECT
   ═══════════════════════════════ */
.phone-row {
    display: flex;
    gap: 10px;
}

.phone-row .select-wrap {
    width: 130px;
    flex-shrink: 0;
}

.phone-row .input-wrap {
    flex: 1;
}

.form-select {
    width: 100%;
    height: 50px;
    padding: 0 8px 0 40px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.25s ease;
}

.form-select:hover {
    border-color: var(--border-active);
}

.form-select:focus {
    border-color: var(--blue-500);
    background: #ffffff;
    box-shadow: var(--shadow-input-focus);
}

.select-wrap {
    position: relative;
}

.select-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-dim);
    width: 16px;
    height: 16px;
}

.select-caret {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-dim);
    width: 14px;
    height: 14px;
}

/* ─── Two Column Grid ─── */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.form-grid-2 .span-2 {
    grid-column: 1 / -1;
}

@media (max-width: 480px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════
   INFO BADGE
   ═══════════════════════════════ */
.info-badge {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.6;
    margin-top: 1rem;
}

.info-badge svg,
.info-badge i {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    color: var(--blue-600);
}

/* ═══════════════════════════════
   SPONSOR VERIFICATION STATES
   ═══════════════════════════════ */
.sponsor-verified {
    color: var(--accent-green) !important;
}

.sponsor-invalid {
    color: var(--accent-red) !important;
}

/* ═══════════════════════════════
   THANK YOU PAGE — Celebration
   ═══════════════════════════════ */
.ty-icon-wrap {
    width: 92px;
    height: 92px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
    border: 2px solid var(--blue-200);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
    animation: iconPulse 2.5s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
    }

    50% {
        box-shadow: 0 16px 40px rgba(37, 99, 235, 0.2);
    }
}

.ty-icon-wrap img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.ty-check-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 30px;
    height: 30px;
    background: var(--gradient-blue);
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkBounce 2s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ty-check-badge svg {
    width: 14px;
    height: 14px;
    color: #fff;
}

@keyframes checkBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* ─── Credential Boxes ─── */
.cred-box {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.cred-box:hover {
    background: var(--blue-50);
    border-color: var(--blue-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.cred-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cred-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--blue-600);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.cred-value.pass {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.08em;
}

.copy-btn {
    width: 38px;
    height: 38px;
    background: #ffffff;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--blue-50);
    border-color: var(--blue-500);
    color: var(--blue-600);
    transform: scale(1.05);
}

.copy-btn svg {
    width: 15px;
    height: 15px;
}

/* ═══════════════════════════════
   THANK YOU — Heading Styles 
   ═══════════════════════════════ */
.ty-heading {
    margin-bottom: 1.5rem;
}

.ty-heading h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.ty-heading p {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.6;
}

.ty-heading strong {
    color: var(--text-primary);
}

.ty-credentials {
    margin-bottom: 1rem;
    text-align: left;
}

.ty-info-badge {
    margin-bottom: 1.5rem;
    text-align: left;
}

/* ═══════════════════════════════
   REGISTER — Card margin override
   ═══════════════════════════════ */
.auth-card-register {
    margin: 1rem auto;
}

.auth-footer-register {
    margin-top: 1.25rem;
}

/* ─── Thank You card override ─── */
.auth-card-thankyou {
    max-width: 500px;
    margin: 1rem auto;
    text-align: center;
}

/* ═══════════════════════════════
   SPINNER ANIMATION — for buttons
   ═══════════════════════════════ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════
   RESPONSIVE TWEAKS
   ═══════════════════════════════ */
@media (max-width: 520px) {
    body {
        padding: 1rem;
    }

    body.has-header {
        padding-top: 70px;
    }

    .auth-card {
        padding: 2rem 1.25rem;
        border-radius: 18px;
    }

    .tv-header {
        height: 50px;
        padding: 0 16px;
    }

    .tv-header-badge {
        display: none;
    }

    .logo-img-wrap {
        width: 64px;
        height: 64px;
    }

    .logo-img-wrap img {
        width: 44px;
        height: 44px;
    }

    .logo-brand-name {
        font-size: 1.15rem;
    }

    .cred-value {
        font-size: 1.15rem;
    }

    .btn-primary {
        height: 48px;
        font-size: 0.82rem;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .phone-row {
        flex-direction: column;
        gap: 8px;
    }

    .phone-row .select-wrap {
        width: 100%;
    }
}