/* ============================================================================
   AUTH PAGES — Stitch flat-card edition
   Centered white card on a calm light surface, soft shadow + thin border.
   No gradient header strip; logo + headline + subtitle live as plain content
   above the form. Auth pages preserve their existing Blade markup — the
   visual change is entirely shell-side.
   ============================================================================ */

body {
    background: var(--surface-0);
    min-height: 100vh;
    font-family: var(--font-family);
    margin: 0;
}

/* Soft ambient glow — kept very subtle to add depth without competing with
   the card. Hidden under prefers-reduced-motion. */
body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    z-index: 0;
}

body::before {
    width: 540px;
    height: 540px;
    background: radial-gradient(circle, rgba(26, 79, 214, 0.18) 0%, transparent 70%);
    top: -160px;
    left: -160px;
}

body::after {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(200, 164, 80, 0.16) 0%, transparent 70%);
    bottom: -160px;
    right: -120px;
}

body > #app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ── Card ──────────────────────────────────────────────────────────────── */
.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--surface-1);
    border-radius: var(--border-radius-xl);     /* 20px — Stitch rounded-xl */
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* ── Header (flat, centered) ───────────────────────────────────────────── */
.login-header {
    background: var(--surface-1);
    color: var(--text-strong);
    padding: var(--spacing-xl) var(--spacing-xl) 0;
    text-align: center;
}

.login-header__logo {
    margin-bottom: var(--spacing-lg);
}

.login-header__logo .app-logo {
    display: inline-flex;
    justify-content: center;
}

.login-header__title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-strong);
    letter-spacing: var(--letter-spacing-tight);
    line-height: 1.2;
    margin: 0 0 var(--spacing-xs);
}

.login-header__subtitle {
    font-size: var(--font-size-md);
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0 0 var(--spacing-xs);
}

/* ── Body ──────────────────────────────────────────────────────────────── */
.login-body {
    padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl);
}

@media (max-width: 575.98px) {
    .login-header { padding: var(--spacing-lg) var(--spacing-lg) 0; }
    .login-body   { padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg); }
    .login-header__title { font-size: var(--font-size-xl); }
}

/* ── Form polish (only the bits Bootstrap defaults miss) ───────────────── */
.login-body .form-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-strong);
    margin-bottom: var(--spacing-xs);
}

.login-body .form-control:focus,
.login-body .form-select:focus {
    border-color: var(--border-focus);
    box-shadow: var(--focus-ring);
}

.link-primary {
    color: var(--secondary-color) !important;
    text-decoration: none !important;
    font-weight: var(--font-weight-medium);
}

.link-primary:hover {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
}

/* ── Section divider ("or continue with") ──────────────────────────────── */
.divider {
    text-align: center;
    margin: var(--spacing-lg) 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--surface-1);
    padding: 0 var(--spacing-md);
    position: relative;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* ──────────────────────────────────────────────────────────────────────────
   Input groups inside the auth card
   ────────────────────────────────────────────────────────────────────────── */

.login-body .input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.login-body .input-group > .form-control,
.login-body .input-group > .form-select {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.login-body .input-group > .form-control,
.login-body .input-group > .form-select,
.login-body .input-group > .input-group-text,
.login-body .input-group > .btn {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    line-height: 1.4;
    font-size: var(--font-size-md);
}

.login-body .input-group > .input-group-text {
    background: var(--surface-2);
    color: var(--text-muted);
    border-color: var(--border-color);
    min-width: 42px;
    justify-content: center;
}

.login-body .input-group > .btn-password-toggle {
    border-color: var(--border-color);
    background: var(--surface-1);
    color: var(--text-muted);
}

.login-body .input-group > .btn-password-toggle:hover {
    background: var(--surface-2);
    color: var(--text-strong);
}

.login-body .input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.login-body .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.login-body .input-group > .form-control:focus,
.login-body .input-group > .form-select:focus {
    position: relative;
    z-index: 3;
}

/* ──────────────────────────────────────────────────────────────────────────
   Password strength meter
   ────────────────────────────────────────────────────────────────────────── */

.login-body .strength-meter {
    height: 4px;
    background: var(--surface-3);
    border-radius: var(--border-radius-pill);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.login-body .strength-meter__fill {
    height: 100%;
    width: 0;
    border-radius: var(--border-radius-pill);
    transition: width 0.25s ease, background-color 0.25s ease;
}

.login-body .strength--weak   { width: 25%;  background: var(--danger-color); }
.login-body .strength--fair   { width: 50%;  background: var(--warning-color); }
.login-body .strength--good   { width: 75%;  background: #f5c518; }
.login-body .strength--strong { width: 100%; background: var(--success-color); }

.login-body .password-match    { color: var(--success-color); }
.login-body .password-mismatch { color: var(--danger-color); }

/* Reduce motion: kill the ambient glow */
@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after { display: none; }
}
