/* =============================================================================
   L&W Platform — Authentication Pages CSS
   ============================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --brand-primary:    #1a56db;
    --brand-primary-h:  #1648c0;
    --brand-accent:     #e8f0fe;
    --text-primary:     #111827;
    --text-secondary:   #6b7280;
    --text-muted:       #9ca3af;
    --border:           #e5e7eb;
    --border-focus:     #1a56db;
    --bg-page:          #f3f4f6;
    --bg-card:          #ffffff;
    --error:            #dc2626;
    --error-bg:         #fef2f2;
    --error-border:     #fca5a5;
    --success:          #16a34a;
    --success-bg:       #f0fdf4;
    --success-border:   #86efac;
    --shadow-card:      0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.08);
    --radius:           12px;
    --radius-sm:        8px;
    --radius-input:     8px;
    --transition:       0.18s ease;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(26, 86, 219, 0.12) 0%, transparent 70%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ── Layout Container ──────────────────────────────────────────────────────── */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* ── Brand Header ──────────────────────────────────────────────────────────── */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.auth-brand__logo {
    width: 52px;
    height: 52px;
    background: var(--brand-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(26, 86, 219, 0.35);
}

.auth-brand__logo svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

.auth-brand__name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.auth-brand__tenant {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    padding: 36px 36px 32px;
}

.auth-card__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.auth-card__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert--error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.alert--success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

/* ── Form ──────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 13px;
    font-size: 15px;
    color: var(--text-primary);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-input);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.form-input.is-invalid {
    border-color: var(--error);
}

/* ── Password field with toggle ───────────────────────────────────────────── */
.input-password-wrapper {
    position: relative;
}

.input-password-wrapper .form-input {
    padding-right: 44px;
}

.btn-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.btn-password-toggle:hover {
    color: var(--text-secondary);
}

.btn-password-toggle svg {
    width: 18px;
    height: 18px;
}

/* ── Checkbox row ──────────────────────────────────────────────────────────── */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 8px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

.form-check__label {
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

/* ── Links ─────────────────────────────────────────────────────────────────── */
.link {
    font-size: 13px;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

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

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-input);
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
    user-select: none;
    width: 100%;
}

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

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.btn-primary:hover {
    background: var(--brand-primary-h);
    border-color: var(--brand-primary-h);
    box-shadow: 0 4px 14px rgba(26, 86, 219, 0.3);
}

.btn-primary:disabled,
.btn-primary.is-loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading spinner inside button */
.btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.btn.is-loading .spinner {
    display: block;
}

.btn.is-loading .btn-text {
    opacity: 0.7;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.auth-card__divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.auth-footer {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ── Password strength meter ───────────────────────────────────────────────── */
.password-strength {
    margin-top: 8px;
}

.password-strength__bar {
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    overflow: hidden;
}

.password-strength__fill {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-strength__label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Two-column name row ───────────────────────────────────────────────────── */
.form-row--names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px 24px;
        border-radius: var(--radius-sm);
    }

    .form-row--names {
        grid-template-columns: 1fr;
    }
}
