:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe3ef;
    --primary: #0f172a;
    --accent: #ea580c;
    --soft: #eef3fb;
    --success: #15803d;
    --danger: #b91c1c;
    --warning: #a16207;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius: 20px;
    --radius-sm: 14px;
    --bg-backoffice: #404a5a;
}

* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}
button,
input,
select {
    font: inherit;
}
button {
    cursor: pointer;
}

.page-shell {
    min-height: 100vh;
}

.customer-shell {
    background: linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
}

.hero {
    position: relative;
    min-height: 46vh;
    display: flex;
    align-items: flex-end;
    padding: 1.25rem;
    background-size: cover;
    background-position: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.84) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 42rem;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--soft);
}

.hero h1,
.admin-topbar h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
}

.hero p {
    margin: 0.9rem 0 0;
    max-width: 30rem;
    color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.customer-main,
.admin-main {
    width: min(1120px, calc(100% - 1.5rem));
    position: relative;
    z-index: 2;
}

.customer-main {
    margin: -1.25rem auto 2.25rem;
}

.admin-main {
    margin: 1rem 0 0;
}

.card-grid {
    display: grid;
    gap: 1rem;
}

.two-up {
    grid-template-columns: 1fr;
}

.info-card,
.booking-card,
.admin-panel,
.service-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(219, 227, 239, 0.7);
    padding: 0;
    overflow: hidden;
}

.info-card,
.service-card {
    padding: 1.2rem;
}

.modal-header {
    flex-shrink: 0;
}

.section-head,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.section-head h2,
.modal-header h2,
.info-card h2,
.service-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.compact-head h2 {
    font-size: 1.1rem;
}

.field-help,
.muted {
    color: var(--muted);
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary);
    font-weight: 600;
}

.booking-grid,
.form-row {
    display: grid;
    gap: 1rem;
    margin-top: 1.1rem;
}

.field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.input-control {
    width: 100%;
    min-height: 50px;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    background: white;
    color: var(--text);
}

.input-control:focus {
    outline: 3px solid rgba(234, 88, 12, 0.14);
    border-color: var(--accent);
}

.compact-input {
    min-width: 180px;
    width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 1.1rem;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        background 0.2s ease;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}
.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-secondary {
    background: var(--soft);
    color: var(--primary);
}
.btn-full {
    width: 100%;
}

.service-fast-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.service-pill {
    min-height: 56px;
    padding: 0.7rem 0.9rem;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    font-weight: 700;
}
.service-pill.active {
    border-color: var(--accent);
    background: rgba(234, 88, 12, 0.08);
    color: var(--accent);
}

.slots-block {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.slots-header-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.selected-summary {
    font-weight: 700;
}

.inline-message {
    margin-top: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: var(--soft);
    color: var(--primary);
}

.inline-message.error {
    background: rgba(185, 28, 28, 0.08);
    color: var(--danger);
}

.inline-message.success {
    background: rgba(21, 128, 61, 0.09);
    color: var(--success);
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.slot-card {
    min-height: 82px;
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: white;
    text-align: left;
}

.slot-card .slot-time {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
}

.slot-card .slot-meta {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.slot-card.free {
    border-color: rgba(21, 128, 61, 0.22);
    background: rgba(21, 128, 61, 0.04);
}

.slot-card.free:hover {
    border-color: var(--accent);
    background: rgba(234, 88, 12, 0.08);
    transform: translateY(-1px);
}

.slot-card.busy {
    opacity: 0.5;
    background: #f8fafc;
}

.slot-card.selected {
    border-color: var(--accent);
    background: rgba(234, 88, 12, 0.12);
}

.booking-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.estimate-box,
.booking-summary-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.1), rgba(15, 23, 42, 0.08));
}

.service-card p {
    color: var(--muted);
}

.service-card .service-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-weight: 700;
}

.admin-body {
    background: #edf2f8;
}

.admin-shell {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.2rem 0 2rem;
}

.admin-topbar {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1.25rem;
    background: var(--bg-backoffice);
    color: white;
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.admin-topbar-title {
    min-width: 0;
}

.admin-topbar-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-content: start;
}

@media (min-width: 720px) {
    .admin-topbar-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.admin-topbar-tools .btn,
.admin-topbar-tools .input-control {
    width: 100%;
}

.admin-topbar-tools #logoutButton.hidden {
    display: none !important;
}

.admin-main {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1rem;
    width: 100%;
    margin: 1rem 0 0;
}

.appointments-list {
    display: grid;
    gap: 0.8rem;
}

.appointment-row {
    display: grid;
    grid-template-columns: 96px 1.3fr 1.1fr auto;
    gap: 0.9rem;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0.95rem;
    background: white;
}

.appointment-time {
    font-size: 1.15rem;
    font-weight: 800;
}

.appointment-service,
.appointment-meta {
    color: var(--muted);
}

.availability-mini {
    margin-top: 1rem;
    display: grid;
    gap: 0.55rem;
}

.mini-slot-row {
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border);
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

.overlay.visible,
.overlay:not(.hidden) {
    display: flex;
}
.hidden {
    display: none !important;
}

.modal-card {
    width: min(100%, 620px);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
    padding: 1.2rem;
    overflow: hidden;
}

.stack-form {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}
.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    font-size: 1.4rem;
}
.quick-suggestions {
    display: grid;
    gap: 0.7rem;
}

.quick-suggestion-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 58px;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: white;
    font-weight: 700;
}

.compact-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 720px) {
    .two-up,
    .booking-grid,
    .form-row.two-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .slots-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .admin-main {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        grid-template-columns: 1fr;
    }

    .appointment-row {
        grid-template-columns: 86px 1fr;
    }
}

@media (max-width: 640px) {
    .customer-main {
        width: calc(100% - 1rem);
    }

    .hero {
        min-height: 52vh;
        padding: 1rem;
    }

    .hero-actions {
        margin-bottom: 1rem;
    }

    .service-fast-grid,
    .slots-grid,
    .compact-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-shell {
        width: calc(100% - 1rem);
    }

    .admin-topbar {
        padding: 1rem;
    }

    .admin-topbar-tools {
        grid-template-columns: 1fr;
    }
}

.popup-card {
    max-width: 460px;
}

.popup-body {
    margin-top: 1rem;
}

.popup-message {
    margin: 0;
    line-height: 1.5;
    color: var(--text);
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.2rem;
}

.service-card-compact {
    padding: 1rem 1.1rem;
}

.service-main-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.service-card-compact h3 {
    margin: 0;
    font-size: 1.05rem;
}

.service-inline-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.service-card-compact p {
    margin: 0.6rem 0 0;
}

@media (min-width: 720px) {
    .service-main-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
    }
}

.booking-grid-rebalanced {
    align-items: start;
}

.form-block-date,
.form-block-services {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.form-block-date {
    display: grid;
    align-content: start;
    gap: 0.4rem;
}

.form-block-services {
    display: grid;
    gap: 0.75rem;
}

.spaced-label {
    margin-top: 0.35rem;
}

.service-description-box {
    margin-top: 0.15rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border);
}

@media (min-width: 720px) {
    .form-block-services .service-fast-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.services-list {
    display: block;
    margin-top: 1.25rem;
}

.services-listing {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(219, 227, 239, 0.7);
    overflow: hidden;
}

.service-list-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--border);
}

.service-list-row:first-child {
    border-top: none;
}

.service-list-main h3 {
    margin: 0;
    font-size: 1rem;
}

.service-list-main p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.service-list-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    white-space: nowrap;
}

.service-duration {
    font-weight: 600;
}

.service-price {
    color: var(--text);
    font-size: 1rem;
}

@media (min-width: 720px) {
    .service-list-row {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .service-list-side {
        justify-content: flex-end;
        min-width: 150px;
    }
}

.services-wrapper {
    margin-top: 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(219, 227, 239, 0.7);
    overflow: hidden;
}

@media (max-width: 640px) {
    .section-head h2 {
        font-size: 1rem;
    }
}

.section-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--accent);
    border-bottom: 1px solid var(--border);
    /*border-bottom: 1px solid rgba(0,0,0,0.05);*/
}

.section-card-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.section-card-body {
    padding: 1.25rem;
    background: var(--card);
}

.section-head-contact {
    align-self: center;
    text-align: right;
    color: var(--soft);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.services-wrapper .section-card-body {
    padding-top: 0;
}

.services-wrapper .section-card-head {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.booking-card .section-card-body {
    background: var(--card);
}

.form-block-date,
.form-block-services {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

#showMorePublicSlotsButton {
    margin-top: 1.25rem;
}

@media (max-width: 640px) {
    .section-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .section-head-contact {
        text-align: left;
    }
}

.trust-band {
    margin-bottom: 1.25rem;
}

.admin-panel .section-card-head {
    background: var(--accent);
}

.admin-panel .section-card-body {
    background: var(--card);
}

.admin-panel-body {
    padding: 1.25rem;
}

.admin-panel-body .field-label:first-of-type {
    margin-top: 0;
}

.admin-panel .eyebrow {
    color: var(--soft);
}

.admin-services-block {
    display: grid;
    gap: 0.75rem;
}

.admin-services-block .service-fast-grid {
    margin-top: 0;
}

.admin-services-block .spaced-label {
    margin-top: 0.35rem;
}

.admin-services-block .availability-mini {
    margin-top: 0.5rem;
}

.mini-slot-action {
    width: 100%;
    background: white;
    cursor: pointer;
    text-align: left;
}

.mini-slot-action:hover {
    border-color: var(--accent);
    background: rgba(234, 88, 12, 0.06);
}

@media (max-width: 640px) {
    .admin-topbar-tools .compact-input {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    #adminDate.input-control {
        padding-right: 0.75rem;
    }
}

@media (max-width: 640px) {
    .admin-topbar-tools {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #adminDate {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        display: block;
    }
}

@media (max-width: 640px) {
    #adminDate {
        -webkit-appearance: none;
        appearance: none;
    }
}

.appointments-window-nav {
    margin-bottom: 0.9rem;
}

.appointments-window-nav:last-child {
    margin-top: 0.9rem;
    margin-bottom: 0;
}

.appointments-window-info {
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: var(--soft);
    align-self: center;
    margin: 0 auto 0.9rem;
    display: table;
}

.appointment-time-range {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.appointment-row-ongoing {
    border-color: var(--accent);
    background: rgba(234, 88, 12, 0.08);
}

.extended-selector {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
}

.extended-selector > * {
    min-width: 0;
}

.quick-modal-card {
    display: flex;
    flex-direction: column;
}

.quick-modal-card,
.extended-selector,
.extended-selector > * {
    min-width: 0;
}

@media (max-width: 640px) {
    .quick-modal-card {
        overflow-x: hidden;
    }
}

.quick-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.quick-modal-body > * {
    min-width: 0;
}

.form-block-date {
    min-width: 0;
}

.form-block-date > * {
    min-width: 0;
}

#bookingDate {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    #bookingDate.input-control {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        padding-left: 0.85rem;
        padding-right: 0.5rem;
        overflow: hidden;
        -webkit-appearance: none;
        appearance: none;
    }
}

.booking-success-panel {
    margin-top: 0;
}

.booking-success-card {
    padding: 1.1rem;
    border: 1px solid rgba(21, 128, 61, 0.18);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(21, 128, 61, 0.06) 0%, rgba(255, 255, 255, 1) 100%);
}

.booking-success-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.booking-success-text {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

.booking-success-summary {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 1.1rem;
}

.booking-success-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border);
}

.booking-success-row span {
    color: var(--muted);
}

.booking-success-row strong {
    text-align: right;
}

@media (max-width: 640px) {
    .booking-success-row {
        flex-direction: column;
        gap: 0.35rem;
    }

    .booking-success-row strong {
        text-align: left;
    }
}

#bookingFlowPanel.hidden {
    display: none !important;
}

.slots-help-text {
    margin-top: 0.35rem;
}

.slot-date {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.booking-services-panel {
    margin-top: 0;
}

.agenda-head-controls {
    display: grid;
    gap: 0.75rem;
    align-items: center;
    min-width: 220px;
}

.agenda-head-controls .compact-input {
    min-width: 0;
    width: 100%;
}

@media (min-width: 720px) {
    .agenda-head-controls {
        min-width: 240px;
    }
}

@media (max-width: 640px) {
    .agenda-head-controls {
        width: 100%;
        min-width: 0;
    }
}

.office-extended-slot {
    min-height: 96px;
}

.office-extended-slot .slot-date {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.office-extended-slot .slot-meta {
    display: block;
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.84rem;
}

@media (max-width: 640px) {
    #quickModal.overlay {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

.hero-legal-name {
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.98rem;
    font-weight: 600;
}

.admin-topbar-legal {
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.98rem;
    font-weight: 600;
}

.login-shop-legal {
    margin-top: 0.6rem;
}

.login-card {
    padding: 0;
    overflow: hidden;
}

.login-card-head {
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, var(--bg-backoffice), rgba(0, 0, 0, 0.15));
    color: white;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.login-card-head h2 {
    margin: 0;
    color: white;
}

.login-card-head .eyebrow {
    color: var(--soft);
}

.login-shop-legal {
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
}

.login-card-body {
    padding: 1.2rem;
}
