/**
 * Public member auth pages (login, register) — shared layout and responsive rules.
 */
:root {
    --auth-primary: #2563eb;
    --auth-primary-soft: rgba(37, 99, 235, 0.12);
    --auth-accent: #4f46e5;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-shadow: 0 22px 55px rgba(15, 23, 42, 0.12);
    --auth-radius: 1.25rem;
}

/* --- Page shell ---------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(ellipse 90% 65% at 0% -10%, rgba(79, 70, 229, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(37, 99, 235, 0.14) 0%, transparent 50%),
        linear-gradient(165deg, #f8fafc 0%, #eef2ff 45%, #e0f2fe 100%);
}

.auth-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.auth-shell--center {
    justify-content: center;
}

@media (min-width: 768px) {
    .auth-shell {
        padding-top: 1.5rem;
        padding-bottom: 2.5rem;
    }
}

/* --- Login card ---------------------------------------------------------- */
.auth-card-login {
    border: none;
    border-radius: var(--auth-radius);
    overflow: hidden;
    box-shadow: var(--auth-shadow);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.auth-card-login__hero {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-accent) 100%);
    color: #fff;
    padding: 1.5rem 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-card-login__hero::after {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.auth-card-login__logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.85rem;
    position: relative;
    z-index: 1;
}

.auth-card-login__title {
    font-weight: 700;
    font-size: clamp(1.2rem, 4vw, 1.45rem);
    margin: 0 0 0.25rem;
    position: relative;
    z-index: 1;
}

.auth-card-login__subtitle {
    margin: 0;
    opacity: 0.92;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.auth-card-login .card-body {
    padding: 1.5rem 1.25rem 1.75rem;
}

@media (min-width: 576px) {
    .auth-card-login__hero {
        padding: 1.75rem 1.5rem;
    }
    .auth-card-login .card-body {
        padding: 2rem 2rem 2.25rem;
    }
}

.auth-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.35rem;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .form-control {
    padding-left: 2.65rem;
    min-height: 48px;
    border-radius: 0.65rem;
    border-color: var(--auth-border);
    font-size: 1rem;
}

.auth-input-wrap .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 0.2rem var(--auth-primary-soft);
}

.auth-input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-muted);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
}

.auth-hint {
    font-size: 0.78rem;
    color: var(--auth-muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}

.auth-btn-submit {
    min-height: 48px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.65rem;
    letter-spacing: 0.02em;
}

.auth-footer-link {
    font-size: 0.9rem;
}

.auth-footer-link a {
    font-weight: 600;
    text-decoration: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
    color: var(--auth-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* --- Register card (existing class names) ------------------------------- */
.auth-wrapper {
    min-height: calc(100dvh - 56px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.register-card {
    border: none;
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.85);
    width: 100%;
    max-width: 900px;
}

.register-card .card-header {
    border-bottom: none;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    color: #fff;
    padding: 1.25rem 1.15rem 1.15rem;
}

.register-card .card-header h3 {
    margin-bottom: 0.25rem;
    font-weight: 700;
    font-size: clamp(1.05rem, 4vw, 1.35rem);
    line-height: 1.3;
}

.register-card .card-header p {
    margin: 0;
    opacity: 0.9;
    font-size: clamp(0.82rem, 2.8vw, 0.95rem);
    line-height: 1.45;
}

.register-header-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.register-header-aside {
    text-align: left;
}

@media (min-width: 768px) {
    .register-card .card-header {
        padding: 1.75rem 1.75rem 1.5rem;
    }
    .register-header-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1.25rem;
    }
    .register-header-aside {
        text-align: right;
        flex-shrink: 0;
    }
}

.floating-label {
    position: relative;
}

.floating-label > label {
    position: absolute;
    top: -0.55rem;
    left: 0.75rem;
    padding: 0 0.35rem;
    background: #fff;
    font-size: 0.72rem;
    color: var(--auth-muted);
    z-index: 2;
    font-weight: 600;
}

.floating-label > input,
.floating-label > select {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    min-height: 48px;
    border-radius: 0.65rem;
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--auth-muted);
    margin-bottom: 0.75rem;
}

.badge-helper {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--auth-muted);
    line-height: 1.45;
}

/* Hide native radio but keep it focusable for keyboard / SR */
.pill-radio .form-check-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pill-radio .form-check {
    position: relative;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.pill-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-radio .form-check-label {
    border-radius: 999px;
    border: 1px solid var(--auth-border);
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--auth-text);
    transition: all 0.18s ease-in-out;
    display: block;
    width: 100%;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pill-radio .form-check-input:focus-visible + .form-check-label {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.pill-radio .form-check-input:checked + .form-check-label {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    color: #fff;
    box-shadow: 0 0 0 0.15rem var(--auth-primary-soft);
}

.register-btn {
    padding: 0.75rem 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.82rem;
    border-radius: 0.65rem;
    min-height: 48px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 576px) {
    .step-indicator {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}

.register-card .card-body .step-indicator .step-pill {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 999px;
    padding: 0.45rem 0.65rem;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    border: 1px solid var(--auth-border);
    color: var(--auth-muted);
    background: #f8fafc;
    font-weight: 500;
}

@media (min-width: 400px) {
    .register-card .card-body .step-indicator .step-pill {
        font-size: 0.68rem;
        padding: 0.5rem 0.75rem;
    }
}

.register-card .card-body .step-indicator .step-pill.active {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    color: #fff;
    border-color: transparent;
    font-weight: 700;
}

.field-error {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.2rem;
}

.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 0.1rem rgba(220, 38, 38, 0.2);
}

/* Section title row stacks on narrow screens */
.form-section-title-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
}

@media (min-width: 576px) {
    .form-section-title-row {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between;
    }
}

/* Touch-friendly alerts */
.auth-page .alert {
    border-radius: 0.75rem;
    font-size: 0.9rem;
}

/* Reduce horizontal overflow */
.auth-page .container {
    max-width: 100%;
}

.register-header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    padding: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.register-header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (min-width: 576px) {
    .register-header-logo {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 575.98px) {
    .auth-page .navbar-brand span {
        font-size: 0.9rem;
        max-width: 52vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Prevents iOS Safari zoom on input focus */
    .floating-label .form-control,
    .auth-input-wrap .form-control {
        font-size: 16px;
    }
}
