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

:root{
    --bg-dark: #060812;
    --panel-dark: rgba(10, 15, 32, 0.88);
    --panel-light: rgba(255, 255, 255, 0.96);
    --primary: #ff3b30;
    --primary-soft: rgba(255, 59, 48, 0.14);
    --text-light: #f7f8ff;
    --text-dark: #18233e;
    --muted: #7c88a7;
    --success: #1f9d63;
    --error: #d84343;
    --border: rgba(123, 145, 192, 0.22);
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body{
    min-height: 100vh;
    color: var(--text-light);
    background:
        radial-gradient(circle at top left, rgba(255, 59, 48, 0.24), transparent 28%),
        radial-gradient(circle at bottom right, rgba(31, 81, 255, 0.22), transparent 30%),
        linear-gradient(135deg, #05070f 0%, #10172c 60%, #05070f 100%);
}

.page-shell{
    min-height: 100vh;
    padding: 1.5rem;
}

.topbar{
    max-width: 1180px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand{
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
}

.brand i{
    color: var(--primary);
    font-size: 1.5rem;
}

.back-link{
    color: #dfe5ff;
    text-decoration: none;
    font-weight: 500;
}

.auth-layout{
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.5rem;
    align-items: stretch;
}

.hero-panel,
.auth-panel{
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
}

.hero-panel{
    padding: 2.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.eyebrow{
    color: #ffb5ae;
    text-transform: uppercase;
    letter-spacing: 0.18rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.hero-panel h1{
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.08;
    margin-bottom: 1rem;
}

.hero-copy{
    color: #d8def6;
    max-width: 54ch;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.hero-points{
    display: grid;
    gap: 1rem;
}

.hero-points div{
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.hero-points i{
    color: var(--primary);
    font-size: 1.3rem;
}

.auth-panel{
    background: var(--panel-light);
    color: var(--text-dark);
    padding: 1.5rem;
}

.tab-switcher{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tab-button{
    border: 1px solid var(--border);
    background: #f2f5ff;
    color: var(--text-dark);
    border-radius: 999px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s ease;
}

.tab-button.active{
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.status-box{
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.status-box.success{
    background: rgba(31, 157, 99, 0.12);
    color: var(--success);
}

.status-box.error{
    background: rgba(216, 67, 67, 0.12);
    color: var(--error);
}

.hidden{
    display: none !important;
}

.auth-form{
    display: none;
}

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

.form-heading{
    margin-bottom: 1rem;
}

.form-heading h2{
    font-size: 1.65rem;
    margin-bottom: 0.35rem;
}

.form-heading p{
    color: var(--muted);
    line-height: 1.6;
}

.field{
    display: block;
    margin-bottom: 0.9rem;
}

.field span{
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.field-input{
    position: relative;
}

.field-input i{
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6d7791;
    font-size: 1.05rem;
}

.field-input input{
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1rem 1rem 2.8rem;
    outline: none;
    font-size: 1rem;
    color: var(--text-dark);
    background: #f8faff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field-input input:focus{
    border-color: rgba(255, 59, 48, 0.45);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.field-input input.input-invalid{
    border-color: rgba(216, 67, 67, 0.55);
    box-shadow: 0 0 0 3px rgba(216, 67, 67, 0.11);
}

.field-error{
    display: block;
    min-height: 1rem;
    margin-top: 0.38rem;
    color: var(--error);
    font-size: 0.78rem;
    font-weight: 500;
}

.remember-row{
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.25rem 0 0.9rem;
    color: #36405d;
    font-size: 0.92rem;
    font-weight: 600;
}

.remember-row input{
    accent-color: var(--primary);
}

.submit-btn,
.secondary-btn{
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 0.95rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.submit-btn{
    background: linear-gradient(135deg, #ff4d44 0%, #ff2f21 100%);
    color: #fff;
    box-shadow: 0 18px 30px rgba(255, 59, 48, 0.22);
}

.submit-btn.is-loading,
.submit-btn:disabled{
    opacity: 0.82;
    cursor: wait;
}

.secondary-btn{
    margin-top: 0.8rem;
    background: #eef2ff;
    color: var(--text-dark);
}

.submit-btn:hover,
.secondary-btn:hover,
.tab-button:hover{
    transform: translateY(-1px);
}

.account-preview{
    margin-top: 1.25rem;
    padding: 1rem;
    background: #f5f7ff;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.account-preview h3{
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.account-preview p{
    color: var(--muted);
    line-height: 1.6;
}

#logoutBtn{
    margin-top: 0.9rem;
}

@media (max-width: 960px){
    .auth-layout{
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px){
    .page-shell{
        padding: 1rem;
    }

    .topbar{
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .hero-panel,
    .auth-panel{
        padding: 1.2rem;
    }

    .tab-switcher{
        grid-template-columns: 1fr;
    }
}
