/* ==========================================================================
   Bin-Ali authentication pages (Login / Sign up)
   Modern-minimal style: whitespace, subtle borders/shadows, single
   confident accent colour (indigo), clean sans-serif type.

   Palette
   -------
   --auth-accent        #4F46E5  indigo-600  (primary actions, focus)
   --auth-accent-dark   #4338CA  indigo-700  (hover)
   --auth-accent-tint   #EEF2FF  indigo-50   (soft backgrounds)
   --auth-ink           #1E293B  slate-800   (headings/body text)
   --auth-ink-soft      #64748B  slate-500   (secondary text)
   --auth-border        #E2E8F0  slate-200   (borders/dividers)
   --auth-surface       #FFFFFF  white       (cards/inputs)
   --auth-danger        #DC2626  red-600     (validation errors)
   Font: 'Inter', system-ui fallback
   ========================================================================== */

:root {
    --auth-accent: #4F46E5;
    --auth-accent-dark: #4338CA;
    --auth-accent-tint: #EEF2FF;
    --auth-ink: #1E293B;
    --auth-ink-soft: #64748B;
    --auth-border: #E2E8F0;
    --auth-surface: #FFFFFF;
    --auth-danger: #DC2626;
}

/* ---------- page shell & topbar ---------- */

body.auth-page {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-accent-tint);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4.5rem 1.5rem 3rem;
}

.auth-topbar {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    z-index: 3;
}

.auth-topbar-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: contain;
}

.auth-topbar-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--auth-ink);
    letter-spacing: -0.01em;
}

@media (max-width: 767.98px) {
    .auth-topbar {
        display: none;
    }
}

/* ---------- layout wrapper & card ---------- */

.auth-wrapper {
    width: 100%;
    max-width: 1000px;
}

.auth-card {
    display: flex;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 20px 40px -20px rgba(30, 41, 59, 0.18);
    overflow: hidden;
    min-height: 560px;
}

/* ---------- left visual / brand panel ---------- */

.auth-visual {
    position: relative;
    flex: 0 0 42%;
    display: flex;
    align-items: stretch;
    background: linear-gradient(160deg, #4338CA 0%, #4F46E5 45%, #6366F1 100%);
    overflow: hidden;
}

.auth-visual-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    padding: 2.25rem 2rem;
    color: #ffffff;
}

.auth-visual .auth-brand {
    color: #ffffff;
}

.auth-visual .auth-brand-mark {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.auth-visual-copy h2 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 2.5rem 0 0.75rem;
    letter-spacing: -0.01em;
}

.auth-visual-copy p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-width: 30ch;
}

.auth-visual-img {
    position: relative;
    align-self: flex-end;
    width: 70%;
    max-width: 260px;
    margin-top: 1.5rem;
    opacity: 0.9;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.25));
    pointer-events: none;
    user-select: none;
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.18), transparent 55%);
    z-index: 1;
}

/* ---------- right form panel ---------- */

.auth-form-panel {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}

.auth-form-inner {
    width: 100%;
    max-width: 380px;
}

/* brand shown at top of the form panel (mobile, and above the card on desktop layouts without a visual) */
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--auth-accent);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
}

.auth-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--auth-ink);
    letter-spacing: -0.01em;
}

.auth-brand--mobile {
    margin-bottom: 1.75rem;
}

.auth-heading {
    margin-bottom: 1.75rem;
}

.auth-heading h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--auth-ink);
    margin: 0 0 0.35rem;
    letter-spacing: -0.01em;
}

.auth-heading p {
    margin: 0;
    color: var(--auth-ink-soft);
    font-size: 0.95rem;
}

/* ---------- form fields ---------- */

.auth-field {
    margin-bottom: 1.15rem;
}

.auth-field-row {
    display: flex;
    gap: 0.85rem;
}

.auth-field-row .auth-field {
    flex: 1 1 0;
}

.auth-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-ink);
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--auth-ink);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: #A0AEC0;
}

.auth-input:hover {
    border-color: #CBD5E1;
}

.auth-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3.5px var(--auth-accent-tint);
}

.auth-input.ng-invalid.ng-touched,
.auth-input.input-validation-error {
    border-color: var(--auth-danger);
}

.auth-input.ng-invalid.ng-touched:focus,
.auth-input.input-validation-error:focus {
    box-shadow: 0 0 0 3.5px rgba(220, 38, 38, 0.12);
}

.field-validation-error,
.text-danger {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--auth-danger);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1.25rem;
    border-radius: 10px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ---------- row helpers ---------- */

.auth-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: -0.35rem 0 1.35rem;
}

.auth-link {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-accent-dark);
    text-decoration: underline;
}

.auth-link-muted {
    color: var(--auth-ink-soft);
    font-size: 0.85rem;
    text-decoration: none;
}

.auth-link-muted:hover {
    color: var(--auth-accent);
}

/* ---------- buttons ---------- */

.auth-btn-primary {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: var(--auth-accent);
    border: 1px solid var(--auth-accent);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.05);
}

.auth-btn-primary:hover {
    background: var(--auth-accent-dark);
    border-color: var(--auth-accent-dark);
}

.auth-btn-primary:active {
    transform: translateY(1px);
}

.auth-btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3.5px var(--auth-accent-tint);
}

/* ---------- footer text under the form ---------- */

.auth-switch {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-ink-soft);
}

.auth-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.78rem;
}

.auth-legal a {
    color: var(--auth-ink-soft);
    text-decoration: none;
}

.auth-legal a:hover {
    color: var(--auth-accent);
}

.auth-legal span {
    color: var(--auth-border);
}

/* ---------- responsive ---------- */

@media (max-width: 767.98px) {
    .auth-card {
        flex-direction: column;
        min-height: 0;
        border-radius: 16px;
    }

    .auth-visual {
        display: none;
    }

    .auth-form-panel {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 420px) {
    .auth-form-panel {
        padding: 1.75rem 1.15rem;
    }

    .auth-field-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ---------- tabs (unified /auth page) ---------- */

.auth-tabs {
    display: flex;
    background: var(--auth-accent-tint);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.75rem;
}

.auth-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.55rem 0.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--auth-ink-soft);
    border-radius: 9px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.auth-tab-btn.active {
    background: var(--auth-surface);
    color: var(--auth-accent);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

/* ---------- remember me / forgot password row ---------- */

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -0.35rem 0 1.35rem;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--auth-ink-soft);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label input {
    width: 15px;
    height: 15px;
    accent-color: var(--auth-accent);
}

/* ---------- social login ---------- */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1.25rem;
    color: var(--auth-ink-soft);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-social-row {
    display: flex;
    gap: 0.75rem;
}

.auth-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-ink);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.auth-social-btn:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
}

.auth-social-btn i {
    font-size: 1rem;
}

/* ---------- forgot password panel ---------- */

.auth-forgot-panel .auth-heading {
    margin-bottom: 1.25rem;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-ink-soft);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem;
}

.auth-back-link:hover {
    color: var(--auth-accent);
}

.auth-success-banner {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 10px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #047857;
    font-size: 0.85rem;
    line-height: 1.5;
}
