@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --auth-bg-dark: #090d16;
    --auth-bg-card: rgba(17, 24, 39, 0.65);
    --auth-border: rgba(255, 255, 255, 0.08);
    --auth-border-focus: #10b981;
    --auth-text-primary: #f8fafc;
    --auth-text-muted: #94a3b8;
    --auth-text-heading: #ffffff;
    --auth-primary: #10b981;
    --auth-primary-hover: #34d399;
    --auth-primary-glow: rgba(16, 185, 129, 0.25);
    --auth-danger: #f87171;
    --auth-danger-bg: rgba(248, 113, 113, 0.1);
    --auth-danger-border: rgba(248, 113, 113, 0.2);
    --auth-success: #34d399;
    --auth-success-bg: rgba(52, 211, 153, 0.1);
    --auth-success-border: rgba(52, 211, 153, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    background-color: var(--auth-bg-dark);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--auth-text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Auth Shell / Container */
.auth-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--auth-bg-dark);
}

/* Background animated glow blobs */
.auth-bg-glows {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.auth-glow-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0) 70%);
    filter: blur(80px);
    animation: pulseGlow 12s ease-in-out infinite alternate;
}

.auth-glow-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0) 70%);
    filter: blur(100px);
    animation: pulseGlow 15s ease-in-out infinite alternate-reverse;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.8; }
    100% { transform: scale(1.15) translate(4%, 4%); opacity: 1; }
}

/* Left Visual Pane */
.auth-visual {
    display: none; /* Desktop only */
    flex: 1;
    position: relative;
    background: radial-gradient(circle at 10% 20%, #064e3b 0%, #022c22 35%, #090d16 85%);
    overflow: hidden;
    padding: 64px;
    z-index: 2;
    border-right: 1px solid var(--auth-border);
}

/* Decorative grid pattern */
.visual-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
}

.visual-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    z-index: 10;
}

.visual-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--auth-text-heading);
    letter-spacing: -0.02em;
}

.visual-logo svg {
    color: var(--auth-primary);
}

.visual-illustration {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 400px;
    margin: auto 0;
}

.chart-svg-container {
    width: 100%;
    max-width: 440px;
    filter: drop-shadow(0 15px 35px rgba(16, 185, 129, 0.15));
}

/* Floating Glass Cards */
.floating-card {
    position: absolute;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 20;
    transition: all 0.3s ease;
}

.floating-card:hover {
    transform: scale(1.03) translateY(-4px);
    border-color: rgba(16, 185, 129, 0.3);
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--auth-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--auth-text-heading);
}

.card-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--auth-success);
    background: rgba(52, 211, 153, 0.15);
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 6px;
    display: inline-block;
}

.float-card-1 {
    top: 15%;
    left: 8%;
    animation: floatCard 6s ease-in-out infinite;
}

.float-card-2 {
    bottom: 12%;
    right: 8%;
    animation: floatCard 7s ease-in-out infinite alternate;
}

@keyframes floatCard {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(0.5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.visual-footer {
    max-width: 460px;
}

.visual-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--auth-text-heading);
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.visual-subtitle {
    font-size: 1rem;
    color: var(--auth-text-muted);
    line-height: 1.6;
}

/* Right Form Container */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 24px;
    position: relative;
    z-index: 10;
    width: 100%;
}

/* Navbar / Language switcher in form panel */
.auth-header {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.auth-mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--auth-text-heading);
}

.auth-mobile-logo svg {
    color: var(--auth-primary);
}

/* Language switcher styled beautifully */
.language-switcher {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--auth-border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.language-switcher a {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.language-switcher a:hover {
    color: var(--auth-text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.language-switcher a.active {
    color: #000000;
    background: var(--auth-text-heading);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* The Glass Card Form Panel */
.auth-panel {
    width: 100%;
    max-width: 420px;
    background: var(--auth-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-panel h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--auth-text-heading);
    margin-bottom: 24px;
    letter-spacing: -0.025em;
    text-align: center;
}

/* Alerts custom styling */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDownAlert 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownAlert {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert.error {
    background-color: var(--auth-danger-bg);
    color: var(--auth-danger);
    border: 1px solid var(--auth-danger-border);
}

.alert.success {
    background-color: var(--auth-success-bg);
    color: var(--auth-success);
    border: 1px solid var(--auth-success-border);
}

/* Form Stack */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text-primary);
}

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

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--auth-text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

/* Style inputs input-wrapper focus */
.input-wrapper input:focus ~ .input-icon {
    color: var(--auth-primary);
}

.input-wrapper input {
    width: 100%;
    min-height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px 12px 46px;
    color: var(--auth-text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

/* Make space at the right for password toggle */
.input-wrapper input#password {
    padding-right: 48px;
}

.input-wrapper input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

/* Password Toggle Icon */
.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--auth-text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.password-toggle-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: -2px;
}

/* Submit Button */
.form-stack button[type="submit"] {
    width: 100%;
    min-height: 48px;
    background: linear-gradient(135deg, var(--auth-primary), #059669);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-stack button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    filter: brightness(1.08);
}

.form-stack button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    filter: brightness(0.95);
}

/* Loading state spin */
.spinner {
    animation: rotate 1s linear infinite;
    display: none;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.sub-links-area {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
}

.sub-links-area .muted {
    color: var(--auth-text-muted);
}

.sub-links-area a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sub-links-area a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Responsive Breakpoints */
@media (min-width: 1024px) {
    .auth-visual {
        display: block; /* Split panel visible */
    }
    
    .auth-container {
        flex: 1;
        width: 50%;
    }

    .auth-header .auth-mobile-logo {
        display: none; /* Hide visual on mobile area because of split pane */
    }

    .auth-header {
        justify-content: flex-end; /* Align lang switcher to right */
    }
}

@media (pointer: coarse) {
    .input-wrapper input {
        min-height: 52px;
    }
    
    .form-stack button[type="submit"] {
        min-height: 52px;
    }
}
