/* =========================================================================
   THESHIFTHUB — public / sign-in layout (login, forgot, reset, verify, ...)
   Loaded by include-top-public.php after tsh-ui.css. Scoped under .tsh-sign.
   ========================================================================= */

body.tsh-auth {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 480px at 50% -8%, var(--tsh-brand-tint), transparent 70%),
        var(--tsh-canvas);
}

.tsh-sign a {
    color: var(--tsh-brand);
    font-weight: 600;
    transition: color .15s ease;
}

.tsh-sign a:hover {
    color: var(--tsh-brand-hover);
    text-decoration: none;
}

/* ---------- Layout ---------- */
.tsh-sign {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 16px;
}

/* Top-aligned variant: leaves room below for dropdowns (select-profile) */
.tsh-sign--top {
    justify-content: flex-start;
    padding-top: clamp(32px, 10vh, 120px);
}

.tsh-sign__card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    background: var(--tsh-surface);
    border: 1px solid var(--tsh-divider);
    border-radius: var(--tsh-radius-lg);
    box-shadow: var(--tsh-shadow-lg);
}

.tsh-sign__card--wide {
    max-width: 860px;
}

/* Pages wrap their content in .card-body — the card already pads it */
.tsh-sign__card .card-body {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.tsh-sign__logo {
    display: block;
    margin-bottom: 32px;
    text-align: center;
}

.tsh-sign__logo img {
    max-width: min(240px, 100%);
    height: auto;
    max-height: 64px;
}

.tsh-sign__title {
    margin: 0 0 6px;
    font-family: var(--tsh-font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: var(--tsh-title-tracking);
    color: var(--tsh-heading);
    text-align: center;
}

.tsh-sign__lead {
    margin: 0 0 28px;
    font-size: 15px;
    color: var(--tsh-muted);
    text-align: center;
}

.tsh-sign__title + :not(.tsh-sign__lead) {
    margin-top: 24px;
}

/* ---------- Form ---------- */
.tsh-sign .form-group {
    margin-bottom: 20px;
}

/* Label row with an inline link on the right (e.g. "Forgot password?") */
.tsh-sign__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.tsh-sign__label-row a {
    margin-bottom: 6px;
    font-size: 13px;
}

.tsh-sign .custom-control {
    margin-bottom: 24px;
}

.tsh-sign__alt {
    margin: 24px 0 0;
    font-size: 14px;
    color: var(--tsh-muted);
    text-align: center;
}

/* Legacy pages' headings inside the card (reset/verify component, privacy) */
.tsh-sign__card h1,
.tsh-sign__card h3 {
    font-family: var(--tsh-font-display);
    font-weight: 700;
    letter-spacing: var(--tsh-title-tracking);
    color: var(--tsh-heading);
}

/* ---------- Footer ---------- */
.tsh-sign__foot {
    margin: 28px 0 0;
    font-size: 13px;
    color: var(--tsh-muted);
    text-align: center;
}

.tsh-sign__foot a {
    color: var(--tsh-heading);
}

.tsh-sign__foot a:hover {
    color: var(--tsh-brand);
}

.tsh-sign__foot-links {
    margin-top: 4px;
}

/* ---------- Entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
    .tsh-sign__card {
        animation: tsh-rise .9s cubic-bezier(.16, 1, .3, 1) .05s both;
    }

    .tsh-sign__foot {
        animation: tsh-fade .9s ease .35s both;
    }
}

/* Long ease-out: most of the travel happens early, then it settles gently */
@keyframes tsh-rise {
    from { opacity: 0; transform: translateY(20px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

@keyframes tsh-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
    body.tsh-auth { background: var(--tsh-surface); }
    .tsh-sign { justify-content: flex-start; padding: 32px 16px; }
    .tsh-sign__card { padding: 8px 4px; border: 0; box-shadow: none; }
    .tsh-sign__logo { margin-bottom: 28px; }
    .tsh-sign__title { font-size: 24px; }
}

/* Legacy pages (password-reset component) use btn-info for their submit */
.tsh-sign .btn-info {
    color: #fff;
    background: var(--tsh-brand);
    border-color: var(--tsh-brand);
    box-shadow: var(--tsh-shadow-sm);
}

.tsh-sign .btn-info:hover,
.tsh-sign .btn-info:focus,
.tsh-sign .btn-info:disabled {
    color: #fff;
    background: var(--tsh-brand-hover);
    border-color: var(--tsh-brand-hover);
}

.tsh-sign .btn-info:disabled {
    opacity: .5;
}

/* ---------- Avatar (select-profile) ---------- */
.tsh-sign__avatar {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    padding: 4px;
    background: var(--tsh-surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--tsh-divider), 0 0 0 5px var(--tsh-brand-tint), var(--tsh-shadow-sm);
}

.tsh-sign__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
