/* =========================================================================
   QuickCare auth shell — public/css/auth-shell.css

   Canonical shared foundation for src/Templates/auth/auth_base.html.twig.
   Loaded directly (unconditionally) by auth_base.html.twig itself, so every
   template that extends it — login, signup, signup-disabled, password
   reset, invitation acceptance, and CRM secure-link states — receives the
   shell chrome (.qc-auth-topbar/.qc-auth-footer/.qc-auth-main), the split
   grid (.qc-auth__grid, incl. the single-column --solo variant), and the
   generic field/card/button/message primitives (.qc-field, .qc-input__control,
   .qc-login-card, .qc-login-submit, …) automatically. No child template
   needs to know this file exists.

   Reuses the shared brand tokens from base-theme.css (--primary-color,
   --text-light, --accent-color, …) and layers a small set of auth-scoped
   accents on top (--qc-auth-*). Everything is scoped under .qc-auth-body /
   .qc-auth* so it cannot leak into other pages.

   Neutral aliases: .qc-auth-card / .qc-auth-submit / .qc-auth-message below
   resolve to the exact same rules as .qc-login-card / .qc-login-submit /
   .qc-login-message so a non-login page (e.g. invitation acceptance, a CRM
   secure-link state) never has to borrow a "login"-branded class name.

   Login's own promotional brand/story panel (.qc-brand-panel and friends)
   is NOT here — that visual is specific to the sign-in page and stays in
   public/css/auth-login.css, which login.html.twig alone loads.
   ========================================================================= */

:root {
    --qc-auth-bg: #f5f3fb;
    --qc-auth-bg-accent: #efeaf9;
    --qc-auth-surface: #ffffff;
    --qc-auth-border: #e7e2f1;
    --qc-auth-radius: 20px;
    --qc-auth-radius-sm: 12px;
    --qc-auth-shadow: 0 24px 60px rgba(60, 14, 107, 0.12);
    --qc-auth-topbar-h: 64px;
}

/* Neutralize the fixed navbar/footer body padding inherited from base-theme.css;
   the auth shell uses its own in-flow topbar + footer and a soft branded wash.
   font-family is pinned to a system stack — this shell intentionally does not
   depend on Google Fonts (see auth_base.html.twig's header comment). */
body.qc-auth-body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1100px 520px at 18% -180px, var(--qc-auth-bg-accent) 0%, rgba(239, 234, 249, 0) 70%),
        radial-gradient(900px 480px at 112% 120%, #ece6f8 0%, rgba(236, 230, 248, 0) 65%),
        var(--qc-auth-bg);
}

/* ── Topbar ───────────────────────────────────────────────────────────── */
.qc-auth-topbar {
    flex-shrink: 0;
}

.qc-auth-topbar__inner {
    max-width: 1180px;
    margin: 0 auto;
    min-height: var(--qc-auth-topbar-h);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.qc-auth-brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    border-radius: 8px;
}

.qc-auth-brand img {
    height: 34px;
    width: auto;
}

.qc-auth-brand:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

.qc-auth-topbar__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--qc-auth-border);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.qc-auth-topbar__badge i {
    color: var(--primary-color);
}

/* ── Main + split grid ────────────────────────────────────────────────── */
.qc-auth-main {
    flex: 1 0 auto;
    width: 100%;
    /* Reset the bare `main { padding; margin-bottom }` rule from base-theme.css. */
    margin: 0;
    padding: 1.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qc-auth {
    width: 100%;
    max-width: 1100px;
}

.qc-auth__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 2.25rem;
    align-items: stretch;
}

.qc-auth__form-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Single-column variant for pages with no second grid track (a status page,
   an invitation link with no company context, a CRM secure-link failure
   state, …) — collapses to one centered column instead of leaving an empty
   track. */
.qc-auth__grid--solo {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
    margin: 0 auto;
}

.qc-auth__grid--solo .qc-auth-card {
    max-width: 100%;
}

/* ── Card (sign-in, or any other auth-shell form/status card) ──────────── */
.qc-login-card,
.qc-auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--qc-auth-surface);
    border: 1px solid var(--qc-auth-border);
    border-radius: var(--qc-auth-radius);
    box-shadow: var(--qc-auth-shadow);
    padding: 2.5rem 2.25rem 2rem;
}

.qc-login-card__head,
.qc-auth-card__head {
    margin-bottom: 1.5rem;
}

.qc-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.9rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: #efeaf9;
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.qc-auth-eyebrow i {
    color: var(--primary-color);
}

.qc-login-card__title,
.qc-auth-card__title {
    font-size: clamp(1.55rem, 1.2rem + 1.4vw, 1.95rem);
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.qc-login-card__subtitle,
.qc-auth-card__subtitle {
    margin: 0;
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* ── Form fields ──────────────────────────────────────────────────────── */
.qc-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.qc-field {
    display: flex;
    flex-direction: column;
}

.qc-field__label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.qc-input {
    position: relative;
    display: flex;
    align-items: center;
}

.qc-input__icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.15s ease;
}

.qc-input__control {
    width: 100%;
    border: 1.5px solid var(--qc-auth-border);
    border-radius: var(--qc-auth-radius-sm);
    background: #fcfbfe;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.4;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.qc-input__control--password {
    padding-right: 3rem;
}

.qc-input__control::placeholder {
    color: #b7afca;
}

.qc-input__control:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(94, 37, 148, 0.14);
}

.qc-input:focus-within .qc-input__icon {
    color: var(--primary-color);
}

.qc-input__toggle {
    position: absolute;
    right: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.qc-input__toggle:hover {
    color: var(--primary-color);
    background: #f3eefb;
}

.qc-input__toggle:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 1px;
    color: var(--primary-color);
}

/* ── Submit button (primary action on any auth-shell card) ──────────────── */
.qc-login-submit,
.qc-auth-submit {
    position: relative;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: var(--qc-auth-radius-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(60, 14, 107, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    text-align: center;
}

.qc-login-submit__label,
.qc-auth-submit__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qc-login-submit:hover:not(:disabled),
.qc-login-submit:focus-visible:not(:disabled),
.qc-auth-submit:hover:not(:disabled),
.qc-auth-submit:focus-visible:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(60, 14, 107, 0.28);
    color: #fff;
}

.qc-login-submit:focus-visible,
.qc-auth-submit:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.qc-login-submit:disabled,
.qc-auth-submit:disabled {
    cursor: progress;
    opacity: 0.8;
    transform: none;
}

.qc-login-submit.is-loading .qc-login-submit__label,
.qc-auth-submit.is-loading .qc-auth-submit__label {
    visibility: hidden;
}

.qc-login-submit.is-loading .qc-login-submit__spinner,
.qc-auth-submit.is-loading .qc-auth-submit__spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Secondary (lower-emphasis) variant — e.g. "sign out and use another account". */
.qc-auth-submit--secondary {
    background: #fff;
    color: var(--primary-dark);
    border: 1.5px solid var(--qc-auth-border);
    box-shadow: none;
}

.qc-auth-submit--secondary:hover:not(:disabled),
.qc-auth-submit--secondary:focus-visible:not(:disabled) {
    background: #faf8fd;
    color: var(--primary-dark);
    box-shadow: none;
    border-color: var(--primary-light);
}

/* ── Inline message (errors / info) ───────────────────────────────────── */
.qc-login-message:not(:empty),
.qc-auth-message:not(:empty) {
    margin-top: 1.1rem;
}

.qc-login-message .qc-alert,
.qc-auth-message.qc-alert,
.qc-auth-message .qc-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 0.95rem;
    border-radius: var(--qc-auth-radius-sm);
    font-size: 0.9rem;
    line-height: 1.45;
}

.qc-login-message .qc-alert i,
.qc-auth-message.qc-alert i,
.qc-auth-message .qc-alert i {
    margin-top: 0.12rem;
    flex-shrink: 0;
}

.qc-login-message .qc-alert--error,
.qc-auth-message.qc-alert--error,
.qc-auth-message .qc-alert--error {
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #8a1f12;
}

.qc-login-message .qc-alert--info,
.qc-auth-message.qc-alert--info,
.qc-auth-message .qc-alert--info {
    background: #eef4fd;
    border: 1px solid #cfe0f7;
    color: #1f4e8a;
}

/* ── Card footer (trust + support) ────────────────────────────────────── */
.qc-login-card__foot,
.qc-auth-card__foot {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--qc-auth-border);
}

.qc-login-trust,
.qc-login-help,
.qc-auth-trust,
.qc-auth-help {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.qc-login-trust,
.qc-auth-trust {
    margin-bottom: 0.5rem;
}

.qc-login-trust i,
.qc-auth-trust i {
    color: var(--accent-color);
}

.qc-login-help a,
.qc-auth-help a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
}

.qc-login-help a:hover,
.qc-login-help a:focus-visible,
.qc-auth-help a:hover,
.qc-auth-help a:focus-visible {
    text-decoration: underline;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.qc-auth-footer {
    flex-shrink: 0;
}

.qc-auth-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 0.8rem;
}

.qc-auth-footer__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    opacity: 0.85;
}

.qc-auth-footer__meta i {
    color: var(--primary-light);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .qc-auth__grid {
        grid-template-columns: 1fr;
    }

    .qc-login-card,
    .qc-auth-card {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (max-width: 575.98px) {
    .qc-auth-main {
        padding: 1rem;
    }

    .qc-auth-topbar__inner {
        padding: 0.75rem 1rem;
    }

    /* Keep only the lock glyph in the topbar badge on the smallest screens. */
    .qc-auth-topbar__badge span:last-child {
        display: none;
    }

    .qc-login-card,
    .qc-auth-card {
        padding: 1.75rem 1.35rem 1.5rem;
        border-radius: 16px;
    }

    .qc-auth-footer__inner {
        padding: 1rem;
    }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .qc-login-submit,
    .qc-auth-submit,
    .qc-input__control,
    .qc-input__icon,
    .qc-input__toggle {
        transition: none !important;
    }

    .qc-login-submit:hover:not(:disabled),
    .qc-login-submit:focus-visible:not(:disabled),
    .qc-auth-submit:hover:not(:disabled),
    .qc-auth-submit:focus-visible:not(:disabled) {
        transform: none;
    }
}
