:root {
    --primary-blue: #1555b5;
    --primary-dark-blue: #08254f;
    --primary-yellow: #ffa200;
    --bg-light: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border-color: #cbd5e1;
    --border-focus: #1555b5;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --shadow-card: 0 8px 32px rgba(21, 85, 181, 0.13), 0 2px 12px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--white);
    color: var(--text-dark);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* App Layout Container */
.app-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: var(--white);
    overflow: hidden;
}

/* Decorative Top-Right Wave – removed (Vector 2.png replaces this) */
.top-right-decor {
    display: none;
}

/* ── IMAGE LAYERS ─────────────────────────────────────────── */

/* Layer 1: Blue diagonal gradient vector – fills the whole page */
.bg-vector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    z-index: 1;
    pointer-events: none;
}

/* Layer 2: Tax-form photo (already masked diagonally in the PNG) */
/* opacity < 1 lets the blue Vector 2 layer show through → blue photo tint */
.bg-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    z-index: 2;
    pointer-events: none;
    opacity: 0.1;
}

/* ── HERO PANEL (text + logo, left side) ─────────────────── */
.hero-panel {
    position: absolute;
    top: 0;
    left: 0;
    /* Cover only the left ~55% so it doesn't block the login card */
    width: 55%;
    height: 100%;
    z-index: 3;           /* above the two image layers */
    pointer-events: none; /* pass clicks through to form */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 3.5rem 3.5rem 3.5rem;
}

/* Remove the old overlay DIV styles – no longer used */
.hero-overlay { display: none; }

.hero-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    pointer-events: auto;
    margin-left: 10rem;
}

/* Logo box – white pill tab hanging from the top */
.logo-container {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--white);
    padding: 1.6rem 3rem 1.8rem 2.5rem;
    border-radius: 0 0 28px 28px;
    width: fit-content;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 10;
    animation: slideDown 0.6s ease-out;
    pointer-events: auto;
}

.escochex-logo {
    display: block;
    height: 100px;
    width: auto;
}

/* Hero Typography */
.hero-text-block {
    margin-bottom: 10rem;
    animation: fadeInUp 0.8s ease-out;
    margin-left: 10rem;
}

.hero-small-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.hero-small-title .light-text {
    font-weight: 400;
    opacity: 0.92;
}

.hero-main-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1.2rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
    font-weight: 400;
    max-width: 440px;
}

/* ── RIGHT PANEL (login card) ────────────────────────────── */
.form-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 48%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 3rem 3rem 2rem;
    z-index: 5;
    background: transparent;
}


/* The Card Panel Container */
.card-panel {
    background-color: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 550px;
    padding: 2.8rem 2.8rem 2.2rem;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.card-panel.active {
    display: flex;
    position: relative;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInCard 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Tighter field gap inside all forms on the card */
.card-panel .mb-3 {
    margin-bottom: 0.75rem !important;
}

.card-panel .mb-4 {
    margin-bottom: 1rem !important;
}

/* Panel Typography */
.panel-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 0.4rem;
}

.panel-title .highlight {
    color: var(--primary-yellow);
    margin-left: 0.3rem;
}

.panel-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2.2rem;
    line-height: 1.4;
}

.panel-subtitle a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.panel-subtitle a:hover {
    text-decoration: underline;
}

/* Inputs & Forms */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper .form-control {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
    outline: none;
    background-color: var(--white);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    height: 48px;
}

.input-wrapper .form-control::placeholder {
    color: #94a3b8;
}

.input-wrapper .form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(21, 85, 181, 0.1);
}

.input-icon {
    position: absolute;
    left: 1.2rem;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

/* Password eye toggle */
.password-toggle {
    position: absolute;
    right: 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    padding: 0.2rem;
    outline: none;
    z-index: 5;
}

/* Remember Me & Forgot Password Layout */
.form-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.6rem;
    font-size: 0.85rem;
}

/* iOS Toggle Slider */
.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.remember-me input {
    display: none;
}

.slider-toggle {
    width: 42px;
    height: 22px;
    background-color: #cbd5e1;
    border-radius: 20px;
    position: relative;
    margin-right: 0.6rem;
    transition: background-color var(--transition-speed);
    display: inline-block;
}

.slider-toggle::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--white);
    position: absolute;
    top: 3px;
    left: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform var(--transition-speed);
}

.remember-me input:checked + .slider-toggle {
    background-color: #94a3b8; /* Match the Figma switch track color */
}

.remember-me input:checked + .slider-toggle::before {
    transform: translateX(20px);
}

.remember-me .label-text {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.9rem;
}

.forgot-password {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 500;
    font-size: 0.9rem;
}

.forgot-password:hover {
    color: var(--primary-dark-blue);
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    outline: none;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-dark-blue);
    box-shadow: 0 4px 12px rgba(21, 85, 181, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background-color: rgba(21, 85, 181, 0.02);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Footer of panels */
.panel-footer {
    margin-top: 1.8rem;
    text-align: center;
    font-size: 0.9rem;
    color: #1e293b;
}

.panel-footer a {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 600;
    margin-left: 0.3rem;
}

.panel-footer a:hover {
    color: var(--primary-dark-blue);
    text-decoration: underline;
}

/* Errors */
.error-msg {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    height: 14px;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.error-msg.visible {
    opacity: 1;
}

.input-wrapper.error .form-control {
    border-color: var(--error-color);
}

/* PANEL 2: ACCOUNT SELECTION SCREEN DESIGN */
.account-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.account-type-card {
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 1.4rem 1rem 1.2rem;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all var(--transition-speed);
    background-color: #edf3fb;  /* light blue card bg matching Figma */
}

.account-type-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-blue);
    box-shadow: 0 8px 20px rgba(21, 85, 181, 0.08);
}

.account-type-card.selected {
    border: 2px dashed var(--primary-blue);
    background-color: #edf3fb;
}

/* Info Icon in Card */
.info-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    color: #94a3b8;
    cursor: help;
    transition: color var(--transition-speed);
}

.info-badge:hover {
    color: var(--primary-blue);
}

/* Radio circle Indicator */
.radio-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background-color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-speed);
}

.account-type-card.selected .radio-indicator {
    border-color: var(--primary-blue);
    background-color: var(--primary-blue);
}

.account-type-card.selected .radio-indicator::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--white);
}

/* Account type PNG image */
.account-type-img {
    width: 120px;
    height: 100px;
    object-fit: contain;
    display: block;
}

.card-icon {
    margin-bottom: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Blue word in card title */
.highlight-blue {
    color: var(--primary-blue);
}

.card-title .highlight-yellow {
    color: var(--primary-yellow);
}

.card-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ── Back button – outlined blue ─────────────────────────── */
.btn-back {
    background-color: var(--white);
    border: 1.5px solid var(--primary-blue);
    color: var(--primary-blue);
    border-radius: 8px;
    height: 48px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-back:hover {
    background-color: rgba(21, 85, 181, 0.05);
    border-color: var(--primary-dark-blue);
    color: var(--primary-dark-blue);
}

.navigation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* PANEL 3: REGISTER ACCOUNT DESIGN */
.account-type-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f5f9;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.account-type-indicator strong {
    color: var(--primary-blue);
}

.change-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.change-link:hover {
    text-decoration: underline;
}

/* Success panel specifics */
.success-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: popIn 0.5s ease;
}

.token-container {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.token-container label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.token-container textarea {
    width: 100%;
    height: 120px;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-dark);
    word-break: break-all;
    margin-bottom: 0.8rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1e293b;
    color: var(--white);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ANIMATIONS */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {
    body {
        overflow-y: auto;
        height: auto;
    }

    .app-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
        position: relative;
    }

    /* Replace full-viewport images with a simple blue bg on tablet/mobile */
    .bg-vector,
    .bg-mask {
        display: none;
    }

    /* Hero panel becomes a visible blue block at the top */
    .hero-panel {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 300px;
        z-index: 1;
        background: linear-gradient(135deg, rgba(21, 85, 181, 0.95) 0%, #08254f 100%);
        pointer-events: auto;
        padding: 2rem 2rem 3rem 2rem;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .hero-overlay { display: none; }

    .hero-content {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .logo-container {
        position: relative;
        left: auto;
        top: auto;
        margin-bottom: 2rem;
        padding: 1rem 2rem;
        border-radius: 12px;
        box-shadow: none;
        width: fit-content;
    }

    .escochex-logo {
        height: 38px;
    }

    .hero-text-block {
        margin-bottom: 0;
    }

    .hero-small-title {
        font-size: 1.25rem;
    }

    .hero-main-title {
        font-size: 2rem;
        line-height: 1.25;
        margin-bottom: 0.9rem;
    }

    .hero-description {
        font-size: 0.95rem;
        max-width: 100%;
    }

    .form-panel {
        position: relative;
        width: 100%;
        height: auto;
        right: auto;
        padding: 3rem 1.5rem;
        z-index: 2;
    }

    .card-panel {
        max-width: 100%;
        width: 100%;
        padding: 2.5rem 1.5rem;
    }
}
