@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600&family=Sora:wght@500;600;700&display=swap');

.auth-page {
    --au-teal-100: #dbeafe;
    --au-teal-500: #3b82f6;
    --au-teal-600: #1e3a8a;
    --au-violet-100: #ede9fe;
    --au-violet-600: #7c3aed;
    --au-slate-50: #f8fafc;
    --au-slate-100: #f1f5f9;
    --au-slate-200: #e2e8f0;
    --au-slate-400: #94a3b8;
    --au-slate-500: #64748b;
    --au-slate-700: #334155;
    --au-slate-800: #1e293b;
    --au-slate-900: #0f172a;
    --au-radius: 16px;
    --au-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);

    font-family: 'DM Sans', 'Public Sans', system-ui, sans-serif;
    color: var(--au-slate-800);
    min-height: calc(100vh - 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.auth-page h1,
.auth-page h2 {
    font-family: 'Sora', 'Public Sans', system-ui, sans-serif;
}

.auth-shell {
    display: grid;
    width: 100%;
    max-width: 920px;
    min-height: 520px;
    overflow: hidden;
    border-radius: var(--au-radius);
    border: 1px solid var(--au-slate-200);
    background: #fff;
    box-shadow: var(--au-shadow);
}

@media (min-width: 768px) {
    .auth-shell {
        grid-template-columns: 1fr 1.05fr;
    }
}

/* Aside */
.auth-aside {
    position: relative;
    padding: 2rem 1.75rem;
    background: linear-gradient(165deg, #0f172a 0%, #1e3a8a 55%, #312e81 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
}

.auth-aside::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.auth-aside-inner {
    position: relative;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.auth-brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 800;
}

.auth-brand strong {
    display: block;
    font-size: 1rem;
}

.auth-brand span {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
}

.auth-aside h1 {
    margin: 2rem 0 0.75rem;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
}

.auth-aside p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
    max-width: 20rem;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-features li::before {
    content: '✓';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.65rem;
    font-weight: 700;
}

/* Form panel */
.auth-panel {
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) {
    .auth-panel {
        padding: 2.25rem 2.5rem;
    }
}

.auth-panel-head {
    margin-bottom: 1.5rem;
}

.auth-panel-head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--au-slate-900);
}

.auth-panel-head p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--au-slate-500);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--au-slate-700);
}

.auth-field label .req {
    color: #dc2626;
}

.auth-input-wrap {
    position: relative;
}

.auth-field input {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border: 1.5px solid var(--au-slate-200);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--au-slate-800);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--au-teal-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.auth-field.has-error input {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.auth-field.is-valid input {
    border-color: #059669;
}

.auth-field .field-error,
.auth-field .field-error-live {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #dc2626;
}

.auth-toggle-pw {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--au-slate-400);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem;
}

.auth-toggle-pw:hover {
    color: var(--au-teal-600);
}

.auth-field input[type="password"] {
    padding-right: 3.5rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--au-slate-600);
}

.auth-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--au-teal-600);
}

.auth-submit {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--au-teal-600), #2563eb);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.28);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.auth-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-switch {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--au-slate-500);
}

.auth-switch a {
    font-weight: 600;
    color: var(--au-teal-600);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.guest-shell .auth-page {
    min-height: 100vh;
}
