/**
 * BudapestCars — Authentication design system
 * Premium marketplace auth: modals, cards, forms, alerts.
 */

:root {
    --bc-auth-navy: #0f1f3e;
    --bc-auth-navy-soft: #1a2d52;
    --bc-auth-text: #0f172a;
    --bc-auth-muted: #5c6b82;
    --bc-auth-line: #e2e8f0;
    --bc-auth-line-strong: #cbd5e1;
    --bc-auth-surface: #ffffff;
    --bc-auth-bg: #f4f6fb;
    --bc-auth-accent: #d92e3f;
    --bc-auth-accent-hover: #c42736;
    --bc-auth-focus: rgba(32, 107, 239, 0.28);
    --bc-auth-shadow: 0 24px 48px rgba(15, 31, 62, 0.12);
    --bc-auth-shadow-soft: 0 12px 32px rgba(15, 31, 62, 0.08);
    --bc-auth-radius-lg: 20px;
    --bc-auth-radius-md: 14px;
    --bc-auth-radius-sm: 10px;
    --bc-auth-font: "Manrope", system-ui, sans-serif;
}

/* ——— Layout: full-page auth (login/register/forgot/reset) ——— */
.bc-auth-main {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.bc-auth-shell {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.bc-auth-shell--wide {
    max-width: 520px;
}

/* ——— Card (page + modal inner) ——— */
.bc-auth-card {
    background: var(--bc-auth-surface);
    border: 1px solid var(--bc-auth-line);
    border-radius: var(--bc-auth-radius-lg);
    box-shadow: var(--bc-auth-shadow-soft);
    padding: 2rem 1.75rem 1.75rem;
    position: relative;
}

@media (min-width: 576px) {
    .bc-auth-card {
        padding: 2.25rem 2rem 2rem;
    }
}

.bc-auth-card__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.bc-auth-card__logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #102244 0%, #1a3763 100%);
    display: grid;
    place-items: center;
    color: #fff;
    font-family: "Sora", sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.bc-auth-card__title {
    font-family: "Sora", var(--bc-auth-font);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    color: var(--bc-auth-navy);
    margin: 0 0 0.35rem;
}

.bc-auth-card__subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.92rem;
    color: var(--bc-auth-muted);
    line-height: 1.45;
}

/* ——— Form ——— */
.bc-form-group {
    margin-bottom: 1rem;
}

.bc-form-group.has-error .bc-input {
    border-color: #e11d48;
    background-color: #fff5f7;
}

.bc-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bc-auth-navy-soft);
    margin-bottom: 0.4rem;
}

.bc-input {
    width: 100%;
    min-height: 46px;
    padding: 0 0.85rem;
    font-family: var(--bc-auth-font);
    font-size: 0.95rem;
    color: var(--bc-auth-text);
    background: #fafbfc;
    border: 1px solid var(--bc-auth-line-strong);
    border-radius: var(--bc-auth-radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bc-input::placeholder {
    color: #94a3b8;
}

.bc-input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.bc-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px var(--bc-auth-focus);
}

.bc-field-error {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #be123c;
}

.bc-form-group.has-error .bc-label {
    color: #9f1239;
}

/* Password row */
.bc-input-row {
    position: relative;
    display: flex;
    align-items: stretch;
}

.bc-input-row .bc-input--password,
.bc-input-row input[type="password"],
.bc-input-row input[type="text"] {
    padding-right: 3rem;
}

.bc-icon-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--bc-auth-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.bc-icon-btn:hover {
    background: rgba(15, 31, 62, 0.06);
    color: var(--bc-auth-navy);
}

.bc-icon-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.bc-icon-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Checkbox */
.bc-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0.25rem 0 1rem;
}

.bc-check input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.15rem;
    accent-color: var(--bc-auth-accent);
    cursor: pointer;
}

.bc-check label {
    font-size: 0.88rem;
    color: var(--bc-auth-muted);
    line-height: 1.4;
    cursor: pointer;
}

.bc-check label a {
    color: var(--bc-auth-navy-soft);
    font-weight: 700;
}

/* Buttons */
.bc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    padding: 0 1.1rem;
    font-family: var(--bc-auth-font);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--bc-auth-radius-sm);
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.bc-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

input.bc-btn[type="submit"] {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.bc-btn--primary {
    background: linear-gradient(130deg, #ef4455, #ce2738);
    color: #fff;
    box-shadow: 0 10px 24px rgba(217, 46, 63, 0.28);
}

.bc-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(217, 46, 63, 0.34);
}

.bc-btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.bc-btn--secondary {
    background: #fff;
    color: var(--bc-auth-navy);
    border: 1px solid var(--bc-auth-line-strong);
    box-shadow: 0 2px 8px rgba(15, 31, 62, 0.04);
}

.bc-btn--secondary:hover:not(:disabled) {
    border-color: #cbd5e1;
    background: #fafbfc;
}

.bc-btn--google {
    background: #fff;
    color: #334155;
    border: 1px solid var(--bc-auth-line-strong);
    font-weight: 600;
}

.bc-btn--google:hover:not(:disabled) {
    background: #f8fafc;
}

.bc-btn__spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bc-spin 0.7s linear infinite;
    display: none;
}

.bc-btn.is-loading .bc-btn__spinner {
    display: block;
}

.bc-btn.is-loading .bc-btn__text {
    opacity: 0.85;
}

@keyframes bc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Divider */
.bc-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--bc-auth-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bc-auth-divider::before,
.bc-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bc-auth-line), transparent);
}

/* Links row */
.bc-auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: -0.25rem 0 1rem;
    font-size: 0.88rem;
}

.bc-auth-link {
    color: var(--bc-auth-navy-soft);
    font-weight: 700;
    text-decoration: none;
}

.bc-auth-link:hover {
    color: var(--bc-auth-accent);
    text-decoration: underline;
}

.bc-auth-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bc-auth-line);
    font-size: 0.78rem;
    color: var(--bc-auth-muted);
    line-height: 1.45;
    text-align: center;
}

.bc-auth-footer a {
    color: var(--bc-auth-navy-soft);
    font-weight: 700;
    text-decoration: none;
}

.bc-auth-footer a:hover {
    text-decoration: underline;
}

.bc-auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--bc-auth-muted);
}

.bc-auth-switch a {
    font-weight: 800;
    color: var(--bc-auth-navy);
    text-decoration: none;
}

.bc-auth-switch a:hover {
    color: var(--bc-auth-accent);
}

/* Google icon */
.bc-google-icon {
    width: 18px;
    height: 18px;
}

/* Mock / info banner */
.bc-auth-banner {
    border-radius: var(--bc-auth-radius-md);
    padding: 0.75rem 0.9rem;
    font-size: 0.86rem;
    line-height: 1.45;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.bc-auth-banner--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a5f;
}

/* Company block */
.bc-auth-details {
    margin: 0.5rem 0 1rem;
    border: 1px dashed var(--bc-auth-line);
    border-radius: var(--bc-auth-radius-md);
    padding: 0.75rem 0.9rem;
    background: #fafbfc;
}

.bc-auth-details summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--bc-auth-navy-soft);
}

.bc-auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

@media (max-width: 420px) {
    .bc-auth-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ——— Modal overlay ——— */
.bc-auth-modal[hidden] {
    display: none !important;
}

.bc-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.bc-auth-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bc-auth-modal__dialog {
    width: 100%;
    max-width: 440px;
    max-height: min(92vh, 720px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bc-auth-surface);
    border-radius: var(--bc-auth-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--bc-auth-shadow);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.bc-auth-modal.is-open .bc-auth-modal__dialog {
    transform: translateY(0) scale(1);
}

.bc-auth-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0;
}

.bc-auth-modal__title {
    font-family: "Sora", var(--bc-auth-font);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bc-auth-navy);
    margin: 0;
}

.bc-auth-modal__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--bc-auth-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.bc-auth-modal__close:hover {
    background: #e2e8f0;
    color: var(--bc-auth-navy);
}

.bc-auth-modal__close:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.bc-auth-modal__body {
    padding: 0.5rem 1.25rem 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
    .bc-auth-modal {
        padding: 0.5rem;
        align-items: flex-end;
    }
    .bc-auth-modal__dialog {
        max-height: 95vh;
        border-radius: var(--bc-auth-radius-lg) var(--bc-auth-radius-lg) 0 0;
    }
}

body.bc-modal-open {
    overflow: hidden;
}

/* ——— Flash messages (global) ——— */
.bc-flash-stack {
    margin-bottom: 1rem;
}

.bc-flash {
    border-radius: var(--bc-auth-radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.bc-flash:last-child {
    margin-bottom: 0;
}

.bc-flash--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.bc-flash--danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.bc-flash--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.bc-flash--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Map Bootstrap alert categories from get_flashed_messages */
.bc-flash--primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* ——— Navbar account ——— */
.bc-nav-account {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.bc-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.95rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
    border: 1px solid transparent;
}

.bc-nav-btn--ghost {
    color: #e8eef8;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.bc-nav-btn--ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.bc-nav-btn--solid {
    background: linear-gradient(130deg, #ef4455, #ce2738);
    color: #fff;
    border: none;
    box-shadow: 0 6px 16px rgba(217, 46, 63, 0.3);
}

.bc-nav-btn--solid:hover {
    color: #fff;
    transform: translateY(-1px);
}

/* Dropdown */
.bc-nav-dd {
    position: relative;
}

.bc-nav-dd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.bc-nav-dd-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}

.bc-nav-dd-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid var(--bc-auth-line);
    border-radius: 14px;
    box-shadow: var(--bc-auth-shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 1050;
}

.bc-nav-dd.is-open .bc-nav-dd-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bc-nav-dd-item {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    color: var(--bc-auth-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s ease;
}

.bc-nav-dd-item:hover {
    background: #f1f5f9;
}

.bc-nav-dd-item--muted {
    color: var(--bc-auth-muted);
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
}

.bc-nav-dd-sep {
    height: 1px;
    background: var(--bc-auth-line);
    margin: 0.35rem 0;
}

.bc-nav-dd-form {
    margin: 0;
    padding: 0;
}

.bc-nav-dd-form .bc-nav-dd-item {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: #be123c;
}

.bc-nav-dd-form .bc-nav-dd-item:hover {
    background: #fff1f2;
}

/* Page shell: no extra card when auth card present */
main.bc-auth-main > .bc-page {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
