/* Client portal (/login, /account) — reuses admin.css for form/button/table
   chrome (label/input/select/textarea/.btn-*/table are all unscoped there),
   this file only adds the page shell around it. */

body {
    font-family: system-ui, sans-serif;
    margin: 0;
    color: #1a1a1a;
    background: #f7f7f8;
}

.client-header {
    background: #2f3437;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.client-header-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.client-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Sits right under the site's normal header (see client_layout.php) — the
   header itself has no idea a client is logged in, so this is the one bit
   of client-only chrome added back on top of it. */
.client-logout-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem 0;
    display: flex;
    justify-content: flex-end;
}

.client-logout-bar form {
    margin: 0;
}

.client-main h1 {
    margin-top: 0;
}

.client-card {
    background: #fff;
    border: 1px solid #e5e5e7;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.client-card h2 {
    margin-top: 0;
}

.client-card small {
    display: block;
    color: #777;
    margin-top: 0.25rem;
}

/* /account's tab nav (see client_dashboard.php) — plain links, no JS
   framework: a small script toggles [hidden] on each .client-tab-panel and
   swaps which link gets .active, keyed off the URL's #hash so a reload or
   a redirect straight back to a specific tab (e.g. after saving a form)
   still opens on the right one. */
.client-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e7;
    padding-bottom: 0.75rem;
}

.client-tab-link {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    white-space: nowrap;
}

.client-tab-link:hover {
    background: #eee;
}

.client-tab-link.active {
    background: #2f3437;
    color: #fff;
}

@media (max-width: 640px) {
    .client-tabs {
        gap: 0.3rem;
    }
    .client-tab-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
    }
}

/* --- /account layout (client_dashboard.php) --------------------------------
   Welcome line with colorful shortcuts on the right, then the account tabs
   stacked on the left and the open panel on the right. */
.client-main:has(.cp-body) {
    max-width: 1040px;
}

.cp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cp-head h1 {
    margin: 0.3rem 0 0;
}

.cp-quick {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 15rem;
}

.cp-quick-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(16, 23, 34, 0.12);
    transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

.cp-quick-link:hover,
.cp-quick-link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 23, 34, 0.18);
    filter: brightness(1.06);
}

.cp-tone-teal { background: #0091ad; }
.cp-tone-orange { background: #e0822a; }
.cp-tone-navy { background: #1c2736; }
.cp-tone-green { background: #2f9e6e; }

.cp-body {
    display: grid;
    grid-template-columns: 13rem 1fr;
    gap: 1.5rem;
    align-items: start;
}

.cp-side {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: sticky;
    top: 1rem;
}

.cp-side .client-tab-link,
.cp-side-link {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2f3437;
    text-decoration: none;
    white-space: normal;
}

.cp-side .client-tab-link:hover,
.cp-side-link:hover {
    background: #e8f7f4;
}

.cp-side .client-tab-link.active {
    background: #2f3437;
    color: #fff;
}

.cp-side-link {
    margin-top: 0.4rem;
    border: 1px solid #cfd6dd;
    color: #0091ad;
}

.cp-main {
    min-width: 0;
}

@media (max-width: 760px) {
    .cp-head {
        flex-direction: column;
    }
    .cp-quick {
        width: 100%;
        min-width: 0;
    }
    .cp-body {
        grid-template-columns: 1fr;
    }
    .cp-side {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .cp-side .client-tab-link,
    .cp-side-link {
        margin-top: 0;
        padding: 0.5rem 0.9rem;
        border-radius: 999px;
    }
}

/* --- /login — the three-tab sign-in card (see client_login.php) ----------- */
/* Scoped entirely under .sf-login so it can be styled in the site's own
   Kanit/Figtree + turquoise look without touching the plainer admin.css
   form chrome the rest of the client portal reuses. */

.sf-login {
    --sf-navy: #0b1825;
    --sf-ink: #1f2733;
    --sf-muted: #5b6573;
    --sf-turq: #45dae7;
    --sf-teal: #0091ad;
    --sf-teal-dark: #007490;
    --sf-line: #e4e8ee;

    font-family: 'Figtree', system-ui, -apple-system, "Segoe UI", sans-serif;
    max-width: 560px;
    margin: 0 auto;
}

.sf-login-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--sf-line);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px rgba(16, 24, 40, .07);
}

/* Decorative concentric rings, echoing the logo mark — purely visual, and
   out of the flow so it never affects the form layout. */
.sf-login-deco {
    position: absolute;
    top: -70px;
    right: -60px;
    width: 220px;
    height: 220px;
    pointer-events: none;
}

.sf-login-head {
    position: relative;
    margin-bottom: 22px;
}

.sf-login-head h1 {
    margin: 0 0 6px;
    font-family: 'Kanit', sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--sf-navy);
}

.sf-login-head p {
    margin: 0;
    max-width: 42ch;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--sf-muted);
}

.sf-login-alert {
    margin: 0 0 18px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
}

.sf-login-alert--error {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: #8f2c22;
}

.sf-login-alert--ok {
    background: #e8f7f4;
    border: 1px solid #a9ddd3;
    color: #14624f;
}

/* Shown right after a login link is sent: highlighted, so it isn't missed. */
.sf-login-alert--spam {
    background: #fff4d6;
    border: 1px solid #f0cf7a;
    border-left: 4px solid #e0a800;
    color: #5c4300;
}

.sf-login-tabs {
    position: relative;
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    background: #f4f6f9;
    border-radius: 12px;
}

.sf-login-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 8px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--sf-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.sf-login-tab svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.sf-login-tab:hover {
    color: var(--sf-teal);
}

.sf-login-tab.is-active {
    background: #fff;
    color: var(--sf-navy);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
}

/* Needed for the same reason as .rs-back-panel[hidden] in scheduler.css —
   an author "display" rule would otherwise beat the browser's built-in
   "[hidden] { display: none }" and every panel would show at once. */
.sf-login-panel[hidden] {
    display: none;
}

.sf-login-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.sf-login-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(150deg, rgba(69, 218, 231, .18), rgba(0, 145, 173, .16));
    color: var(--sf-teal);
}

.sf-login-badge svg {
    width: 19px;
    height: 19px;
}

.sf-login-panel-head h2 {
    margin: 2px 0 3px;
    font-family: 'Kanit', sans-serif;
    font-size: 17px;
    font-weight: 500;
    color: var(--sf-navy);
}

.sf-login-panel-head p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--sf-muted);
}

.sf-login-form label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sf-ink);
}

.sf-login-form label small {
    display: inline;
    margin-left: 4px;
    font-weight: 400;
    color: #8a97a3;
}

.sf-login-form input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 13px;
    border: 1px solid var(--sf-line);
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 400;
    color: var(--sf-ink);
    transition: border-color .12s ease, box-shadow .12s ease;
}

.sf-login-form input:focus {
    outline: none;
    border-color: var(--sf-teal);
    box-shadow: 0 0 0 3px rgba(0, 145, 173, .12);
}

.sf-login-btn {
    width: 100%;
    margin-top: 6px;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: var(--sf-teal);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background .15s ease;
}

.sf-login-btn:hover {
    background: var(--sf-teal-dark);
}

.sf-login-foot {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--sf-muted);
}

.sf-login-foot a {
    color: var(--sf-teal);
}

@media (max-width: 560px) {
    .sf-login-card {
        padding: 22px 18px;
    }
    .sf-login-tabs {
        flex-direction: column;
    }
    .sf-login-tab {
        justify-content: flex-start;
        font-size: 13px;
    }
}
