/*
 * MERA KHATA V2.0 - PREMIUM KIOSK AUTHENTICATION CSS
 * Implements a distraction-free, centered login layout with floating labels,
 * subtle glassmorphism, and elegant background animations.
 */

/* ==========================================================================
   LAYOUT & BACKGROUND
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.navbar .logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #4f46e5;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none
}

.navbar .logo span {
    color: #1e293b
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 24px
}

.navbar .nav-links a {
    color: #475569;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s
}

.navbar .nav-links a:hover {
    color: #4f46e5
}

@media(max-width:600px) {
    .navbar .nav-links {
        display: none
    }
}

.auth-layout {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
}

.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    margin: auto;
    padding: var(--space-4);
    padding-bottom: 50px;
    /* Extra padding for keyboard visibility */
    animation: scaleUp var(--transition-spring);
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

/* ==========================================================================
   ANIMATED BACKGROUND SHAPES
   ========================================================================== */
.bg-shape {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    z-index: 1;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.15);
    /* Brand 500 */
    top: -10%;
    left: -10%;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.15);
    /* Purple */
    bottom: -5%;
    right: -5%;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: rgba(56, 189, 248, 0.1);
    /* Sky */
    top: 40%;
    left: 60%;
    animation-duration: 15s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

/* ==========================================================================
   AUTH CARD
   ========================================================================== */
.auth-card {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    border-radius: 50%;
    margin-bottom: var(--space-4);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.brand-icon {
    font-size: 1.75rem;
    color: var(--brand-600);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-1) 0;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ==========================================================================
   INPUTS & FLOATING LABELS
   ========================================================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.input-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color var(--transition-fast);
    z-index: 2;
}

.input-field {
    width: 100%;
    height: 56px;
    padding: 20px 16px 8px 44px;
    /* Space for icon and floating label */
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

.floating-label {
    position: absolute;
    left: 44px;
    /* Align with input text, past icon */
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 2;
}

/* Floating Label Animation Trigger */
.input-field:focus,
.input-field:not(:placeholder-shown) {
    border-color: var(--brand-500);
}

.input-field:focus~.floating-label,
.input-field:not(:placeholder-shown)~.floating-label {
    top: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-600);
}

.input-field:focus~.input-icon {
    color: var(--brand-600);
}

/* Eye Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-secondary);
    background: var(--brand-50);
}

.password-toggle.active {
    color: var(--brand-600);
}

/* ==========================================================================
   ERROR HANDLING
   ========================================================================== */
.error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    animation: shake 0.4s var(--ease-spring);
}

.field-error-text {
    color: var(--danger-solid);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 6px;
    margin-left: 4px;
    display: none;
    animation: slideDown 0.2s var(--ease-smooth);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

/* Error State Modifiers */
.input-group.has-error .input-field {
    border-color: var(--danger-solid);
    background: #fffafa;
}

.input-group.has-error .input-icon,
.input-group.has-error .floating-label {
    color: var(--danger-solid) !important;
}

.input-group.has-error .field-error-text {
    display: block;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* ==========================================================================
   BUTTON & FOOTER
   ========================================================================== */
.auth-submit-btn {
    height: 52px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-md);
}

.auth-footer {
    margin-top: var(--space-8);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-footer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.auth-app-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: center;
    margin-top: 9px;
    padding: 8px 12px;
    border-radius: 9px;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}
.auth-app-download:hover, .auth-app-download:focus-visible { background: #eff6ff; text-decoration: underline; }

.system-status {
    color: var(--success-solid) !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ==========================================================================
   DESKTOP TWO-GRID LAYOUT (UPSELL)
   ========================================================================== */
.hidden-mobile {
    display: none;
}

@media (min-width: 900px) {
    .hidden-mobile {
        display: block;
    }

    .auth-wrapper {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        max-width: 1100px;
        gap: var(--space-8);
        padding: var(--space-6);
        align-items: center;
    }

    .auth-card {
        max-width: 100%;
        /* Fill the grid column */
        border: 1px solid rgba(255, 255, 255, 0.8);
        background: var(--bg-surface);
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.06);
    }

    /* Marketing Panel */
    .auth-marketing {
        position: relative;
        color: var(--text-primary);
        padding: var(--space-8) var(--space-6);
        animation: fadeRight 0.8s var(--ease-smooth);
    }

    .badge-premium {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #fef08a, #facc15);
        color: #854d0e;
        border-radius: var(--radius-pill);
        font-weight: 700;
        font-size: 0.85rem;
        margin-bottom: var(--space-4);
        box-shadow: 0 4px 12px rgba(250, 204, 21, 0.3);
    }

    .marketing-title {
        font-family: var(--font-display);
        font-size: 3rem;
        font-weight: 800;
        line-height: 1.1;
        margin-bottom: var(--space-4);
        background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-600) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .marketing-subtitle {
        font-size: 1.2rem;
        color: var(--text-secondary);
        margin-bottom: var(--space-8);
        line-height: 1.5;
    }

    .feature-list {
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
    }

    .feature-item {
        display: flex;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
        background: var(--brand-50);
        color: var(--brand-600);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .feature-text strong {
        display: block;
        font-size: 1.1rem;
        margin-bottom: 4px;
        color: var(--text-primary);
    }

    .feature-text span {
        color: var(--text-secondary);
        font-size: 0.95rem;
    }

    @keyframes fadeRight {
        from {
            opacity: 0;
            transform: translateX(-30px);
        }

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

/* ==========================================================================
   PREMIUM UPGRADE MODAL
   ========================================================================== */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-smooth);
}

.premium-modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.premium-modal-card {
    background: #fff;
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    border: 2px solid #fef08a;
    /* Golden border */
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s var(--ease-spring);
}

.premium-modal-overlay:not(.hidden) .premium-modal-card {
    transform: translateY(0) scale(1);
}

.premium-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-app);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.premium-close-btn:hover {
    background: var(--danger-bg);
    color: var(--danger-solid);
}

.premium-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.premium-icon-ring {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fef08a, #facc15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: 2rem;
    color: #854d0e;
    box-shadow: 0 8px 24px rgba(250, 204, 21, 0.3);
}

.premium-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.premium-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.premium-benefits {
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.benefit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.benefit-row:last-child {
    margin-bottom: 0;
}

.benefit-row i {
    color: var(--success-solid);
    font-size: 1.1rem;
}

.premium-pricing {
    text-align: center;
    margin-bottom: var(--space-6);
}

.premium-pricing .price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-display);
}

.premium-pricing .duration {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn--premium {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: #fff;
    box-shadow: 0 8px 16px rgba(202, 138, 4, 0.3);
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn--premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(202, 138, 4, 0.4);
}

/* ==========================================================================
   PREMIUM MODAL TABS & CONTENT
   ========================================================================== */
.premium-tabs {
    display: flex;
    gap: var(--space-2);
    background: var(--bg-app);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #fff;
    color: var(--brand-600);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
    animation: fadeRight 0.3s var(--ease-smooth);
}

.tab-content.active {
    display: block;
}

/* Plans Grid */
.plans-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.plan-card {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: #fef08a;
    background: #fefce8;
}

.plan-card.selected {
    border-color: #eab308;
    background: #fefce8;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.15);
}

.plan-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.plan-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.plan-price {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-align: right;
}

/* Device List */
.device-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 250px;
    overflow-y: auto;
}

.device-item {
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-light);
}

.device-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.device-details strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.device-details span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-remove-device {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-device:hover {
    background: #ef4444;
    color: #fff;
}

/* OTP Overlay */
.otp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    animation: scaleUp 0.3s var(--ease-spring);
}

.otp-overlay h3 {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.otp-overlay p {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.otp-input {
    width: 100%;
    max-width: 200px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    font-family: monospace;
    font-weight: 700;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s;
}

.otp-input:focus {
    border-color: var(--brand-600);
}

/* ==========================================================================
   SIGNUP & AUTH TOGGLE
   ========================================================================== */
.auth-toggle-container {
    display: flex;
    gap: var(--space-2);
    background: var(--bg-app);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.auth-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: calc(var(--radius-lg) - 4px);
    cursor: pointer;
    transition: all 0.2s;
}

.auth-toggle-btn.active {
    background: #fff;
    color: var(--brand-600);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-view {
    display: none;
    animation: fadeRight 0.3s var(--ease-smooth);
}

.auth-view.active {
    display: block;
}

/* ==========================================================================
   ROLE TOGGLE & TOOLTIPS
   ========================================================================== */
.role-toggle {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    padding: 4px;
    margin-bottom: var(--space-6);
    position: relative;
}

.role-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.role-btn.active {
    color: #fff;
}

.role-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    border-radius: var(--radius-pill);
    z-index: 1;
    transition: transform 0.3s var(--ease-spring);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.role-toggle[data-active="cashier"] .role-slider {
    transform: translateX(100%);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.info-tooltip {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: help;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.info-tooltip .tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 10px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    right: -10px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.info-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 16px;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ==========================================================================
   LOGIN PHASE 1 — PROFESSIONAL ONLINE-FIRST AUTH EXPERIENCE
   ========================================================================== */
/* Legacy experiment disabled. It created competing visual systems.
.auth-layout {
    background:
        radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.10), transparent 28rem),
        radial-gradient(circle at 88% 82%, rgba(30, 58, 138, 0.08), transparent 26rem),
        #f1f5f9;
}

.auth-layout .bg-shape {
    position: fixed;
    max-width: 82vw;
    pointer-events: none;
}

.navbar {
    position: relative;
    height: 76px;
    padding-inline: clamp(18px, 4vw, 56px);
    background: linear-gradient(125deg, #2563eb 0%, #3b82f6 54%, #4f46e5 100%);
    border-bottom: 0;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.22);
}

.navbar .logo {
    color: #fff;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #fff;
    box-shadow: 0 6px 14px rgba(30, 58, 138, 0.18);
}

.brand-name {
    color: #fff !important;
}

.brand-name strong {
    color: #dbeafe;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-copy small {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.navbar .nav-links a {
    color: rgba(255, 255, 255, 0.82);
}

.navbar .nav-links a:hover {
    color: #fff;
}

.auth-wrapper {
    padding: 24px 16px 48px;
}

.auth-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #2563eb, #38bdf8, #8b5cf6);
}

.auth-toggle-container {
    padding: 5px;
    margin-bottom: 28px;
    background: #eef2f7;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
}

.auth-toggle-btn {
    min-height: 44px;
    border-radius: 8px;
}

.auth-toggle-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.20);
}

.auth-header {
    margin-bottom: 28px;
}

.brand-logo {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, #3b82f6, #4f46e5);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.28);
}

.brand-icon {
    color: #fff;
    font-size: 1.45rem;
}

.auth-title {
    font-size: clamp(1.55rem, 6vw, 1.85rem);
    font-weight: 800;
    color: #0f172a;
}

.auth-subtitle {
    margin-top: 6px;
    color: #64748b;
}

.auth-form {
    gap: 18px;
}

.input-field {
    height: 58px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
}

.input-field:focus,
.input-field:not(:placeholder-shown) {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-50);
}

.field-hint {
    margin: 6px 4px 0;
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.4;
}

.input-group.has-error .field-hint {
    display: none;
}

.auth-submit-btn {
    min-height: 54px;
    margin-top: 4px !important;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26);
}

.login-help-row {
    display: flex;
    justify-content: center;
    margin-top: -4px;
}

.forgot-password-btn {
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: var(--brand-600);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.login-connectivity-note,
.online-first-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 14px;
}

.login-connectivity-note {
    padding: 11px 12px;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border: 1px solid #bfdbfe;
    color: #475569;
    font-size: 0.76rem;
    line-height: 1.45;
}

.login-connectivity-note i {
    margin-top: 2px;
    color: var(--brand-600);
}

.auth-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.system-status {
    color: var(--text-secondary) !important;
}

.system-status i {
    color: var(--success-solid);
}

@media (min-width: 900px) {
    .auth-wrapper {
        grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
        max-width: 1160px;
        gap: clamp(40px, 7vw, 88px);
    }

    .auth-marketing {
        padding: 44px 38px;
        border-radius: var(--radius-lg);
        background: linear-gradient(145deg, #0f172a, #1e3a8a);
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
        overflow: hidden;
    }

    .badge-premium {
        background: rgba(255, 255, 255, 0.10);
        color: #bfdbfe;
        border: 1px solid rgba(191, 219, 254, 0.25);
        box-shadow: none;
    }

    .marketing-title {
        max-width: 600px;
        font-size: clamp(2.8rem, 5vw, 4.2rem);
        line-height: 1.02;
        color: #fff;
        background: none;
        -webkit-text-fill-color: currentColor;
    }

    .marketing-subtitle {
        max-width: 610px;
        font-size: 1.1rem;
        color: #cbd5e1;
    }

    .feature-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-item {
        padding: 14px;
        border: 1px solid rgba(255, 255, 255, 0.10);
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.07);
    }

    .feature-icon {
        background: rgba(147, 197, 253, 0.14);
        color: #93c5fd;
    }

    .feature-text strong {
        color: #fff;
    }

    .feature-text span {
        color: #cbd5e1;
    }

    .online-first-note {
        max-width: 610px;
        margin-top: 20px;
        padding: 14px 16px;
        background: rgba(15, 23, 42, 0.46);
        border: 1px solid rgba(147, 197, 253, 0.18);
        color: #fff;
    }

    .online-first-note i {
        margin-top: 3px;
        color: #60a5fa;
    }

    .online-first-note strong,
    .online-first-note span {
        display: block;
    }

    .online-first-note span {
        margin-top: 2px;
        color: #cbd5e1;
        font-size: 0.84rem;
    }

    .login-connectivity-note {
        display: none;
    }
}

@media (max-width: 899px) {
    .navbar {
        height: 84px;
        align-items: flex-start;
        padding-top: 14px;
    }

    .navbar .logo {
        font-size: 1.25rem;
    }

    .auth-wrapper {
        margin: -18px auto 0;
        max-width: 440px;
        z-index: 12;
    }
}

@media (max-width: 420px) {
    .auth-wrapper {
        padding: 16px 12px 36px;
    }

    .auth-card {
        padding: 22px 16px;
        border-radius: var(--radius-lg);
    }

    .auth-toggle-container,
    .auth-header {
        margin-bottom: 22px;
    }
}
*/

/* ==========================================================================
   LOGIN RESCUE — SHARED KHATA WALLAH DESIGN SYSTEM
   ========================================================================== */
.auth-layout {
    --login-blue: #2563eb;
    --login-blue-2: #3b82f6;
    --login-violet: #8b5cf6;
    --login-gradient: linear-gradient(135deg, var(--login-blue), var(--login-blue-2));
    background: #f1f5f9;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
}

.navbar {
    position: relative;
    height: 68px;
    padding: 0 clamp(18px, 4vw, 52px);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    box-shadow: none;
}

.navbar .logo {
    gap: 10px;
    color: var(--text-primary);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--login-blue), var(--login-violet));
    color: #fff;
    box-shadow: var(--shadow-md);
}

.brand-name,
.navbar .logo .brand-name {
    color: var(--text-primary);
}

.brand-name strong {
    color: var(--login-blue);
}

.navbar .nav-links a {
    color: var(--text-secondary);
}

.navbar .nav-links a:hover {
    color: var(--brand-600);
}

.auth-layout .bg-shape {
    display: none;
}

.auth-wrapper {
    max-width: 420px;
    margin: auto;
    padding: 24px 16px 44px;
    animation: none;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.auth-toggle-container {
    gap: 4px;
    padding: 4px;
    margin-bottom: 24px;
    background: #f1f5f9;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.auth-toggle-btn {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--text-secondary);
}

.auth-toggle-btn.active {
    background: var(--bg-surface);
    color: var(--login-blue);
    box-shadow: var(--shadow-sm);
}

.auth-header {
    padding: 22px 18px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--login-blue), var(--login-violet));
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.brand-logo {
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: none;
}

.brand-icon {
    color: #fff;
    font-size: 1.25rem;
}

.auth-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

.auth-subtitle {
    margin-top: 5px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.84);
}

.auth-form {
    gap: 16px;
}

.input-field {
    height: 54px;
    padding-top: 19px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
}

.input-field:focus,
.input-field:not(:placeholder-shown) {
    border-color: var(--login-blue);
    box-shadow: 0 0 0 4px #eff6ff;
}

.field-hint {
    margin: 6px 4px 0;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.4;
}

.input-group.has-error .field-hint {
    display: none;
}

.auth-submit-btn {
    min-height: 52px;
    margin-top: 2px !important;
    border-radius: var(--radius-md);
    background: var(--login-gradient);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    font-family: 'Inter', sans-serif;
}

.login-help-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.forgot-password-btn {
    min-height: 40px;
    padding: 8px 2px 8px 10px;
    border: 0;
    background: transparent;
    color: var(--login-blue);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.login-connectivity-note,
.online-first-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: var(--radius-md);
}

.login-connectivity-note {
    padding: 10px 12px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.4;
}

.login-connectivity-note i {
    margin-top: 2px;
    color: var(--login-blue);
}

.auth-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.system-status {
    color: var(--text-secondary) !important;
}

.system-status i {
    color: var(--success-solid);
}

@media (min-width: 900px) {
    .auth-wrapper {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(380px, 0.92fr);
        align-items: stretch;
        max-width: 1100px;
        gap: 32px;
        padding: 32px 24px 48px;
    }

    .auth-marketing {
        display: flex;
        position: relative;
        align-items: center;
        padding: 40px;
        overflow: hidden;
        color: var(--text-primary);
        background: linear-gradient(145deg, #eff6ff, #f5f3ff);
        border: 1px solid #dbeafe;
        border-radius: var(--radius-lg);
        animation: none;
    }

    .badge-premium {
        padding: 6px 11px;
        margin-bottom: 16px;
        background: var(--bg-surface);
        color: var(--login-blue);
        border: 1px solid #dbeafe;
        box-shadow: none;
    }

    .marketing-title {
        max-width: 520px;
        margin-bottom: 14px;
        color: var(--text-primary);
        background: none;
        -webkit-text-fill-color: currentColor;
        font-size: clamp(2.4rem, 4vw, 2.75rem);
        line-height: 1.08;
        font-family: 'Inter', sans-serif;
    }

    .marketing-subtitle {
        max-width: 540px;
        margin-bottom: 28px;
        color: var(--text-secondary);
        font-size: 1rem;
    }

    .feature-list {
        gap: 16px;
    }

    .feature-item {
        gap: 14px;
    }

    .feature-icon {
        width: 44px;
        height: 44px;
        background: var(--bg-surface);
        color: var(--login-blue);
        border: 1px solid #dbeafe;
        box-shadow: var(--shadow-sm);
    }

    .feature-text strong {
        color: var(--text-primary);
        font-size: 1rem;
    }

    .feature-text span {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .online-first-note {
        max-width: 540px;
        margin-top: 24px;
        padding: 12px 14px;
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid #dbeafe;
        color: var(--text-primary);
    }

    .online-first-note i {
        margin-top: 3px;
        color: var(--login-blue);
    }

    .online-first-note strong,
    .online-first-note span {
        display: block;
    }

    .online-first-note span {
        margin-top: 2px;
        color: var(--text-secondary);
        font-size: 0.8rem;
    }

    .login-connectivity-note {
        display: none;
    }

    .auth-card {
        align-self: center;
        width: 100%;
        max-width: 420px;
        padding: 32px;
    }
}

@media (max-width: 899px) {
    .navbar {
        height: 64px;
    }

    .navbar .logo {
        font-size: 1.25rem;
    }

    .auth-wrapper {
        margin: 0 auto;
    }
}

@media (max-width: 420px) {
    .auth-wrapper {
        padding: 20px 12px 36px;
    }

    .auth-card {
        padding: 20px;
        border-radius: 18px;
        box-shadow: var(--shadow-sm);
    }

    .auth-toggle-container,
    .auth-header {
        margin-bottom: 20px;
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-wrapper,
    .auth-marketing,
    .auth-view,
    .error-banner {
        animation: none !important;
    }
}

/* Login device-limit recovery */
.device-limit-card{max-width:620px;max-height:min(92vh,850px);overflow-y:auto;border:1px solid #dbe3ee;padding:24px}
.device-limit-header{display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:14px;align-items:center;text-align:left;margin:0 26px 16px 0}
.device-limit-header .premium-icon-ring,.device-limit-card .otp-card .premium-icon-ring{width:52px;height:52px;margin:0;border-radius:15px;font-size:1.25rem;background:#dbeafe;color:#1d4ed8;box-shadow:none}
.device-limit-header h2{margin:3px 0 4px;font-size:1.3rem}.device-limit-header p{margin:0;font-size:.82rem;line-height:1.45}
.device-limit-eyebrow{font-size:.66rem;text-transform:uppercase;letter-spacing:.09em;font-weight:800;color:#2563eb}
.device-limit-usage{padding:8px 10px;border-radius:9px;background:#eff6ff;color:#1d4ed8;font-size:.76rem;white-space:nowrap}
.device-limit-safety{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;margin-bottom:16px;border:1px solid #fcd34d;border-radius:11px;background:#fffbeb;color:#78350f;font-size:.79rem;line-height:1.5}
.device-limit-safety i{margin-top:2px;flex:none}
.device-limit-card .premium-tabs{margin-bottom:14px}.device-limit-copy{margin:0 0 12px;color:#475569;font-size:.8rem;line-height:1.5}
.device-limit-card .device-list{max-height:310px;gap:9px}
.device-limit-card .device-item{gap:12px;background:#fff;border-color:#dbe3ee;padding:13px}
.device-limit-card .device-info{min-width:0}.device-limit-card .device-details{min-width:0}.device-limit-card .device-details strong{overflow-wrap:anywhere;font-size:.86rem}
.device-limit-card .device-details span{display:block;line-height:1.4}.device-limit-card .btn-remove-device{border-radius:8px;white-space:nowrap;padding:8px 11px}
.device-limit-card .btn-remove-device:disabled{opacity:.55;cursor:wait}
.device-limit-retry{display:inline-flex;align-items:center;gap:7px;margin-top:13px;padding:7px 0;border:0;background:transparent;color:#1d4ed8;font-weight:700;font-size:.79rem;cursor:pointer}
.device-limit-retry:disabled{opacity:.45;cursor:wait}.device-limit-timer{display:inline-block;margin-left:12px;color:#64748b;font-size:.77rem}
.device-limit-card .plans-grid{max-height:270px}.device-limit-card .plan-card{cursor:default;gap:12px}
.device-limit-card .otp-overlay{background:rgba(255,255,255,.98);padding:22px}
.device-limit-card .otp-card{position:relative;width:100%;max-width:380px}
.device-limit-card .otp-card .premium-icon-ring{margin:0 auto 12px}
.device-limit-card .otp-card h3{font-size:1.2rem}.device-limit-card .otp-card p{margin-bottom:10px}
.device-limit-card .otp-input{max-width:240px}.device-limit-error{min-height:20px;color:#b91c1c;font-size:.78rem}
@media(max-width:600px){.device-limit-card{padding:18px;max-height:94vh}.device-limit-header{grid-template-columns:44px minmax(0,1fr);margin-right:24px}.device-limit-header .premium-icon-ring{width:42px;height:42px}.device-limit-usage{grid-column:2;justify-self:start}.device-limit-card .device-item{align-items:flex-start}.device-limit-card .btn-remove-device{align-self:center}.device-limit-card .device-icon{display:none}}

.device-limit-ack{display:flex;align-items:flex-start;gap:9px;margin:0 0 15px;color:#334155;font-size:.78rem;line-height:1.4;cursor:pointer}.device-limit-ack input{margin-top:3px;accent-color:#1d4ed8;flex:none}
.device-limit-timer[hidden]{display:none}
