/* ============================================================
   auth.css  —  Shared styles for login, forgot, reset pages
   Colour scheme: dark purple (#1a1060), blue (#2563eb), white
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --purple-deep:   #1a1060;
    --purple-dark:   #140d4f;
    --purple-mid:    #2d1a8c;
    --purple-light:  #ede9ff;
    --purple-faint:  #f5f3ff;
    --blue:          #2563eb;
    --blue-light:    #dbeafe;
    --white:         #ffffff;
    --gray-50:       #f8f9fb;
    --gray-100:      #f0f2f8;
    --gray-200:      #e2e8f0;
    --gray-300:      #cbd5e1;
    --gray-500:      #64748b;
    --gray-700:      #374151;
    --gray-900:      #111827;
    --error:         #dc2626;
    --error-bg:      #fef2f2;
    --success:       #16a34a;
    --success-bg:    #f0fdf4;
    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     16px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 16px rgba(26,16,96,0.12);
    --shadow-lg:     0 8px 32px rgba(26,16,96,0.16);
    --transition:    0.18s ease;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    color: var(--gray-900);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
}

/* ── Shell layout ─────────────────────────────────────────── */
.auth-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Left brand panel ─────────────────────────────────────── */
.auth-brand {
    width: 420px;
    flex-shrink: 0;
    background: var(--purple-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

/* Subtle decorative circles */
.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: #ffffff;
}
.auth-brand::before {
    width: 360px;
    height: 360px;
    top: -100px;
    right: -100px;
}
.auth-brand::after {
    width: 240px;
    height: 240px;
    bottom: -80px;
    left: -60px;
}

.brand-inner {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Logo mark */
.brand-logo {
    margin-bottom: 28px;
}

.logo-mark {
    display: inline-flex;
    gap: 4px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-md);
    padding: 10px 18px;
}

.logo-mark span {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 2px;
}
.logo-s { color: #ffffff; }
.logo-r { color: #a78bfa; }
.logo-p { color: #60a5fa; }

.brand-name {
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

.brand-tagline {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 36px;
}

/* Feature list */
.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.80);
    font-size: 14px;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(96,165,250,0.20);
    border-radius: 50%;
    color: #60a5fa;
    font-size: 12px;
    flex-shrink: 0;
}

/* ── Right form panel ─────────────────────────────────────── */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    overflow-y: auto;
}

.auth-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 60px 40px 40px;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.flash--success {
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
    color: var(--success);
}

.flash--error {
    background: var(--error-bg);
    border: 1px solid #fecaca;
    color: var(--error);
}

.flash-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.flash-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Form header ──────────────────────────────────────────── */
.form-header {
    margin-bottom: 32px;
}

.form-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--purple-deep);
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.5;
}

/* ── Form elements ────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.label-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--blue);
    text-decoration: none;
}
.label-link:hover {
    text-decoration: underline;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 13px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 44px 0 42px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder {
    color: var(--gray-300);
}

.form-input:focus {
    border-color: var(--purple-mid);
    box-shadow: 0 0 0 3px rgba(45,26,140,0.10);
}

.form-input.input--error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

/* Password toggle button */
.toggle-password {
    position: absolute;
    right: 13px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition);
}
.toggle-password:hover {
    color: var(--purple-deep);
}

/* Field-level error */
.field-error {
    font-size: 12px;
    color: var(--error);
    min-height: 16px;
    display: block;
}

/* ── Inline row (remember me) ─────────────────────────────── */
.form-row-inline {
    display: flex;
    align-items: center;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--purple-deep);
    border-color: var(--purple-deep);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

/* ── Submit button ────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    height: 48px;
    background: var(--purple-deep);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background var(--transition), transform var(--transition);
    margin-top: 4px;
}

.btn-submit:hover:not(:disabled) {
    background: var(--purple-mid);
}

.btn-submit:active:not(:disabled) {
    transform: scale(0.99);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner inside button */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-submit.loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Back link ────────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
    text-decoration: none;
    margin-bottom: 20px;
    transition: color var(--transition);
}
.back-link:hover {
    color: var(--purple-deep);
}

/* ── Auth footer ──────────────────────────────────────────── */
.auth-footer {
    padding: 20px 40px;
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
    border-top: 1px solid var(--gray-100);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
    .auth-brand {
        display: none;
    }

    .auth-form-panel {
        background: var(--gray-100);
    }

    .auth-form-wrap {
        background: var(--white);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        margin: 24px 16px;
        padding: 36px 28px;
    }
}

@media (max-width: 480px) {
    .auth-form-wrap {
        margin: 16px 12px;
        padding: 28px 20px;
    }

    .form-title {
        font-size: 22px;
    }
}
