/* ============================================================
   Client portal (/my). DEK-branded, not tenant-branded: a client is not
   scoped to any one salon here. Loaded only by layouts/client.php;
   CssLayoutScopeTest knows this layout, so classes may live here.
   ============================================================ */

.cli-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--c-bg);
}

/* ---- Header ---- */
.cli-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: max(var(--sp-4), env(safe-area-inset-top)) var(--sp-5) var(--sp-4);
    border-bottom: 1px solid var(--c-border);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}
.cli-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-body-lg);
    font-weight: 800;
    letter-spacing: .3px;
    color: var(--c-ink);
    text-decoration: none;
}
.cli-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--grad-primary);
    box-shadow: 0 3px 8px rgba(99, 91, 255, 0.35);
}

.cli-header__right { display: flex; align-items: center; gap: var(--sp-2); }
.cli-nav { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); }
.cli-nav a {
    color: var(--c-text-soft);
    text-decoration: none;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-full);
    transition: color var(--t-fast), background var(--t-fast);
}
.cli-nav a:hover { color: var(--c-ink); }
.cli-nav a.is-active { color: var(--c-action); background: var(--c-primary-tint); font-weight: 600; }

.cli-logout__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    color: var(--c-text-soft);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast);
}
.cli-logout__btn:hover { color: var(--c-error); background: var(--c-surface-low); }

/* ---- Bottom tab bar (mobile portal nav) ---- */
.cli-tabbar { display: none; }

/* ---- Main ---- */
.cli-main {
    flex: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-4);
}

.cli-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-card);
}

.cli-reliability { margin-bottom: var(--sp-5); }
.cli-reliability__hint { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); }

.cli-form { display: flex; flex-direction: column; gap: var(--sp-4); }

/* ---- Auth ---- */
.cli-auth__title { font-size: var(--fs-h2); margin: 0 0 var(--sp-1); }
.cli-auth__subtitle { color: var(--c-text-soft); font-size: var(--fs-sm); margin: 0 0 var(--sp-5); }


.cli-alert {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-4);
}
.cli-alert--error { background: var(--c-error-tint, #fee2e2); color: var(--c-error); }
.cli-alert--info { background: var(--c-primary-tint, #ede9fe); color: var(--c-action); }

/* ---- Social (disabled, "soon") ---- */
.cli-social { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.cli-social__divider {
    height: 1px;
    background: var(--c-border);
    margin: var(--sp-4) 0;
}
.cli-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    opacity: .6;
    cursor: not-allowed;
}

/* ---- Portal ---- */
.cli-portal__title { font-size: var(--fs-h2); margin: 0 0 var(--sp-5); }
.cli-portal__section {
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-text-soft);
    margin: var(--sp-5) 0 var(--sp-2);
}

.cli-bookings { display: flex; flex-direction: column; gap: var(--sp-2); }
.cli-bookings--past { opacity: .8; }

.cli-booking {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
}
.cli-booking__when {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
    min-width: 116px;
}
.cli-booking__body { flex: 1 1 auto; min-width: 0; }
.cli-booking__service { font-weight: 600; overflow-wrap: anywhere; }
.cli-booking__salon { font-size: var(--fs-sm); color: var(--c-text-soft); }

@media (max-width: 480px) {
    .cli-booking { flex-wrap: wrap; }
    .cli-booking__when { min-width: 0; }
}

/* ---- Profile ---- */
.cli-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-bottom: var(--sp-2);
}
.cli-readonly {
    margin: 0;
    padding: var(--sp-2) 0;
    color: var(--c-ink);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.cli-danger {
    margin-top: var(--sp-6);
    padding-top: var(--sp-4);
    border-top: 1px dashed var(--c-border-strong);
}

/* ---- Footer ---- */
.cli-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    padding: var(--sp-5);
    font-size: var(--fs-sm);
    color: var(--c-text-faint);
}
.cli-footer a { color: var(--c-text-faint); text-decoration: none; }

/* ---- Mobile: the header links become an app-style bottom tab bar ---- */
.cli-tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
    padding: 6px 8px;
    border-radius: var(--r-md);
    color: var(--c-text-faint);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--t-fast), transform var(--t-fast);
}
.cli-tabbar__item:active { transform: scale(0.94); }
.cli-tabbar__item.is-active { color: var(--c-action); }

@media (max-width: 640px) {
    .cli-nav--desktop { display: none; }

    .cli-tabbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: var(--z-sticky);
        display: flex;
        justify-content: space-around;
        padding: var(--sp-2) var(--sp-2) calc(var(--sp-2) + env(safe-area-inset-bottom));
        background: var(--glass-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--c-border);
    }

    /* Reserve room so content and footer are never hidden behind the tab bar. */
    .cli-body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
    .cli-main { padding: var(--sp-5) var(--sp-4); }
}

/* ---- Phones: nothing wider than the screen ---- */
.cli-readonly { flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }   /* the e-mail on the profile */
.cli-tabbar__item > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
