/*
 * Colours: the salon chooses page, header, buttons and accent (Ρυθμίσεις → Online κρατήσεις); every text colour is
 * derived from them (PublicTheme) and set as the variables below on :root by the page. The defaults here are the
 * "Noir & Gold" theme, used until the salon's settings arrive. Cards, options and inputs stay white with dark text,
 * so they read well on any page colour.
 */
:root {
    --page-bg: #faf8f4;
    --on-page: #1f1b18;
    --muted-on-page: #6f665c;
    --link-on-page: #8a6a1f;
    --header-bg: #1f1b18;
    --on-header: #ffffff;
    --button: #1f1b18;
    --on-button: #ffffff;
    --accent: #c5a04a;
    --on-accent: #1f1b18;
    --accent-ink: #8a6a1f;

    --surface: #ffffff;
    --surface-text: #1f1b18;
    --surface-muted: #6f665c;
    --border: #e8e2d6;
    --danger: #b91c1c;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, white);
    color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--page-bg);
    color: var(--on-page);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

.shell { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted-on-page); }

/* ---------- header (colour, or the cover photo with a dark veil) ---------- */
.site-header {
    display: flex; align-items: center; gap: 14px;
    margin: 8px 0 18px; padding: 18px 20px; border-radius: 18px;
    background: var(--header-bg); color: var(--on-header);
    box-shadow: inset 0 -3px 0 var(--accent), 0 10px 24px rgba(31, 27, 24, 0.12);
}
.site-header.has-cover {
    min-height: 170px; align-items: flex-end; color: #fff;
    background-size: cover; background-position: center;
}
.site-header.has-cover h1 { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45); }
.site-logo {
    width: 64px; height: 64px; flex: none; border-radius: 14px; padding: 6px;
    background: #fff; object-fit: contain; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.site-heading { min-width: 0; }
.site-header h1 { font-size: 1.45rem; margin: 0; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.site-sub { opacity: 0.85; font-size: 0.95rem; margin-top: 2px; }

/* ---------- text on the page ---------- */
h2 { font-size: 1.15rem; margin: 20px 0 10px; }
.welcome { margin: 0 0 8px; }
.muted { color: var(--muted-on-page); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.link { background: none; border: 0; color: var(--link-on-page); font: inherit; cursor: pointer; padding: 8px 0; }

/* ---------- white surfaces: always dark text ---------- */
.card, .option, .day, .time, .history, .notice {
    color: var(--surface-text);
}
.card .muted, .option .muted, .history .muted, .notice .muted { color: var(--surface-muted); }
.card .link, .history .link { color: var(--accent-ink); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.alert { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }

.list { display: grid; gap: 8px; }
.group-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-on-page); margin-top: 8px; }
.option {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
    font: inherit; cursor: pointer; min-height: 52px;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { opacity: 0.5; cursor: default; }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.option-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.option-side { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--on-accent); font-weight: 700; flex: none;
}

.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.day {
    display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); font: inherit; cursor: pointer;
}
.day strong { font-size: 1.3rem; }
.day:hover { border-color: var(--accent); background: var(--accent-soft); }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.time {
    padding: 10px 0; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    font: inherit; font-weight: 600; cursor: pointer;
}
.time:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* ---------- forms (labels on the page, inputs white) ---------- */
.form { display: grid; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted-on-page); }
.form input:not([type=checkbox]), .form textarea {
    font: inherit; color: var(--surface-text); padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.form input:focus, .form textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.form .check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--on-page); }
.form .check input { margin-top: 3px; accent-color: var(--accent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- buttons ---------- */
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.primary {
    margin-left: auto; background: var(--button); color: var(--on-button); border: 0; border-radius: 999px; padding: 12px 22px;
    font: inherit; font-weight: 600; cursor: pointer; min-height: 46px;
}
.primary:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 0 0 2px var(--accent); }
.primary:disabled { opacity: 0.5; cursor: default; }
.danger { margin-left: auto; background: var(--danger); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.danger:disabled { opacity: 0.5; }

.summary { display: grid; gap: 10px; }
.summary div { display: flex; flex-direction: column; }
.done .tick {
    width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 50%; background: var(--button); color: var(--on-button);
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem; box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- signed-in visitor: account bar, my appointments, history ---------- */
.account-bar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin: -8px 4px 12px; }
.account-bar .link { padding: 4px 0; font-size: 0.92rem; }
.notice { background: color-mix(in srgb, var(--accent) 12%, white); border: 1px solid color-mix(in srgb, var(--accent) 35%, white); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.appt { display: grid; gap: 4px; }
.appt .actions { margin-top: 6px; }
.appt-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.history { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.history-row { display: grid; grid-template-columns: 86px 1fr auto; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); align-items: baseline; }
.history-row:first-child { border-top: 0; }
.center-actions { justify-content: center; }
.center-actions .link { margin: 0 6px; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px;
    background: #fffbeb; border-top: 1px solid #fde68a; color: #1f1b18;
}
#blazor-error-ui .reload { margin-left: 8px; }

@media (max-width: 420px) {
    .site-header { padding: 14px; gap: 12px; }
    .site-header.has-cover { min-height: 140px; }
    .site-logo { width: 52px; height: 52px; }
    .site-header h1 { font-size: 1.25rem; }
}
