/**
 * StayClient design system (UI/UX SKILL.md)
 * Toegankelijkheid, focus, touch targets, reduced motion.
 */

/* Skip link */
.skip-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 200;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: var(--color-primary-600, #0d9488);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    transform: translateY(-200%);
    transition: transform 0.2s ease;
}
.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid var(--color-primary-400, #2dd4bf);
    outline-offset: 2px;
}

/* Focus zichtbaar (niet verwijderen) */
:focus-visible {
    outline: 2px solid var(--color-primary-500, #0d9488);
    outline-offset: 2px;
}

a,
button,
[role="button"],
input[type="submit"],
input[type="button"] {
    touch-action: manipulation;
}

/* Inline Tabler SVG */
.icon-inline {
    display: inline-block;
    vertical-align: middle;
    line-height: 0;
    flex-shrink: 0;
}

.icon-inline svg {
    display: block;
}

/* Formulieren: leesbare labels */
label {
    color: var(--color-text-strong, #0f172a);
}

/* Salonlogo-placeholder (initialen) - dashboard + app */
.tenant-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    font-weight: 700;
    font-style: normal;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.04em;
    text-align: center;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Min touch / click area op icon-only knoppen */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 0.75rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .mk-card-hover:hover {
        transform: none;
    }
}

/* Legal document */
.mk-legal-doc {
    max-width: 48rem;
}

.mk-legal-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: background 0.15s, color 0.15s;
}

.mk-legal-nav a:hover {
    background: var(--color-surface-muted);
    color: var(--color-text-strong);
}

.mk-legal-nav a.is-active {
    background: color-mix(in srgb, #0d9488 12%, transparent);
    color: #0d9488;
    font-weight: 600;
}

.mk-legal-doc .mk-prose h2 {
    margin-top: 2.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border-soft);
}

.mk-legal-doc .mk-prose h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.mk-legal-doc .mk-prose h3 {
    margin-top: 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-strong);
}

.mk-legal-doc .mk-prose a {
    color: var(--color-primary-600);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mk-legal-doc .mk-prose ul,
.mk-legal-doc .mk-prose ol {
    margin: 0.75rem 0 1rem;
    padding-left: 1.35rem;
}

.mk-legal-doc .mk-prose li {
    margin-bottom: 0.35rem;
}

.mk-legal-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.mk-legal-callout {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface-muted);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Dashboard / admin shell header + profile menu */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.platform-shell-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    height: 3.5rem;
    border-bottom: 1px solid var(--color-border-soft);
    background: color-mix(in srgb, var(--color-surface) 95%, transparent);
    backdrop-filter: blur(12px);
}

@media (min-width: 1024px) {
    .platform-shell-header {
        position: sticky;
        left: auto;
        right: auto;
    }
}

.platform-shell-menu-btn {
    border: none;
    background: transparent;
}

.platform-shell-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .platform-shell-header__inner {
        justify-content: flex-end;
        padding: 0 2rem;
    }
}

.platform-profile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.platform-profile-trigger:hover {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary-500, #0d9488) 25%, transparent);
}

.platform-profile-trigger:focus-visible {
    outline: 2px solid var(--color-primary-500, #0d9488);
    outline-offset: 2px;
}

.platform-profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: var(--color-primary-600, #0d9488);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
}

.platform-profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 12.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface);
    box-shadow: var(--shadow-popup);
    overflow: hidden;
}

.platform-profile-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.platform-profile-dropdown__item:hover,
.platform-profile-dropdown__item.is-active {
    background: var(--color-surface-muted);
    color: var(--color-text-strong);
}

/* Bevestigings- en meldingsdialogen */
#stay-confirm-dialog {
    position: relative;
    z-index: 300;
}

.stay-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 301;
    background: color-mix(in srgb, #0f172a 45%, transparent);
    backdrop-filter: blur(2px);
}

.stay-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 302;
    width: min(24rem, calc(100vw - 2rem));
    transform: translate(-50%, -50%);
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface);
    box-shadow: var(--shadow-popup);
}

.stay-dialog__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-text-strong);
    line-height: 1.35;
}

.stay-dialog__message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.stay-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

/* Klanten-app: dialoog boven bottom nav op mobiel */
.app-shell .stay-dialog {
    top: auto;
    bottom: calc(1rem + var(--app-bottom-nav-offset, calc(4rem + env(safe-area-inset-bottom, 0px))));
    transform: translateX(-50%);
    max-height: calc(100dvh - var(--app-bottom-nav-offset, calc(4rem + env(safe-area-inset-bottom, 0px))) - 2rem);
    overflow-y: auto;
}

@media (min-width: 640px) {
    .app-shell .stay-dialog {
        top: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        max-height: min(90dvh, 640px);
    }
}

.app-shell--no-bottom-nav .stay-dialog {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
