/* ===========================
   DESIGN VARIABLES
=========================== */

:root {
    --sidebar: #12263a;
    --sidebar-light: #1c3853;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --green: #15803d;
    --green-light: #dcfce7;
    --background: #f4f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #6b7688;
    --border: #dfe5ec;
    --disabled-background: #f1f3f6;
    --disabled-text: #929baa;
    --shadow: 0 12px 30px rgba(25, 42, 70, 0.08);
    --radius: 18px;
}


/* ===========================
   GLOBAL STYLES
=========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-color: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
input[type="radio"] {
    cursor: pointer;
}

textarea {
    resize: vertical;
}


/* ===========================
   SIDEBAR
=========================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--sidebar);
    color: white;
    padding: 28px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 42px;
    color: white;
    font-size: 1.05rem;
    line-height: 1.2;
}

.brand strong {
    display: block;
    color: #8db8ff;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background-color: var(--primary);
    color: white;
    font-size: 1.2rem;
    font-weight: 900;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    border-radius: 12px;
    padding: 12px 14px;
    color: #b9c7d6;
    font-weight: 700;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--sidebar-light);
    color: white;
}

.nav-icon {
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    border-radius: 16px;
    background-color: var(--sidebar-light);
    padding: 18px;
}

.sidebar-footer p {
    margin-bottom: 12px;
    color: #cad7e4;
    font-size: 0.9rem;
}

.sidebar-footer a {
    display: block;
    border-radius: 10px;
    background-color: var(--primary);
    color: white;
    padding: 10px 14px;
    text-align: center;
    font-weight: 800;
}


/* ===========================
   APPLICATION CONTAINER
=========================== */

.app-container {
    min-height: 100vh;
    margin-left: 250px;
}


/* ===========================
   TOP BAR
=========================== */

.topbar {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    background-color: var(--surface);
    padding: 18px 40px;
}

.page-label,
.section-label {
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar h1 {
    font-size: 1.65rem;
    line-height: 1.2;
}

.back-link {
    color: var(--primary);
    font-weight: 800;
}

.back-link:hover {
    text-decoration: underline;
}


/* ===========================
   MAIN CONTENT
=========================== */

main {
    padding: 34px 40px 70px;
}

.booking-layout {
    max-width: 1450px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 28px;
    margin: 0 auto;
}


/* ===========================
   BOOKING PANEL
=========================== */

.booking-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    padding: 34px;
    box-shadow: var(--shadow);
}

.section-heading {
    margin-bottom: 32px;
}

.section-heading h2 {
    margin-bottom: 8px;
    font-size: 1.8rem;
}

.section-heading > p:last-child {
    max-width: 700px;
    color: var(--muted);
}


/* ===========================
   FORM SECTIONS
=========================== */

fieldset {
    border: 0;
    border-top: 1px solid var(--border);
    padding: 30px 0;
}

fieldset:first-of-type {
    border-top: 0;
    padding-top: 0;
}

legend {
    margin-bottom: 18px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 900;
}

.field-description,
.availability-note {
    color: var(--muted);
    font-size: 0.85rem;
}

.field-description {
    margin-bottom: 16px;
}

.availability-note {
    margin-top: 12px;
}


/* ===========================
   WORKSPACE OPTIONS
=========================== */

.workspace-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.workspace-option {
    position: relative;
    display: block;
}

.workspace-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.workspace-option-content {
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background-color: white;
    padding: 16px;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.workspace-option:hover .workspace-option-content {
    border-color: #a9bfe8;
}

.workspace-option input:checked + .workspace-option-content {
    border-color: var(--primary);
    background-color: #f6f9ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.room-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 900;
}

.workspace-option strong,
.workspace-option small {
    display: block;
}

.workspace-option small {
    margin-top: 3px;
    color: var(--muted);
}


/* ===========================
   FORM INPUTS
=========================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group {
    min-width: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 11px;
    background-color: white;
    color: var(--text);
    padding: 12px 13px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-group textarea {
    min-height: 120px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* ===========================
   TIME SLOTS
=========================== */

.time-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.time-slot {
    position: relative;
    display: block;
}

.time-slot input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.time-slot span {
    min-height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background-color: white;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        color 160ms ease;
}

.time-slot:not(.unavailable):hover span {
    border-color: var(--primary);
}

.time-slot input:checked + span {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

.time-slot.unavailable span {
    border-color: transparent;
    background-color: var(--disabled-background);
    color: var(--disabled-text);
    cursor: not-allowed;
    text-decoration: line-through;
}


/* ===========================
   FORM ACTIONS
=========================== */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 28px;
}

.primary-button,
.secondary-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    padding: 12px 20px;
    font-weight: 800;
    transition: background-color 160ms ease, transform 160ms ease;
}

.primary-button {
    border: 0;
    background-color: var(--primary);
    color: white;
}

.primary-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.secondary-button {
    border: 1px solid var(--border);
    background-color: white;
    color: var(--text);
}

.secondary-button:hover {
    background-color: var(--background);
}


/* ===========================
   SUMMARY PANEL
=========================== */

.summary-panel {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 18px;
}

.summary-card,
.help-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    padding: 24px;
    box-shadow: var(--shadow);
}

.summary-card h2 {
    margin-bottom: 20px;
    font-size: 1.35rem;
}

.summary-room {
    display: grid;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 22px;
}

.summary-room-image {
    min-height: 145px;
    display: flex;
    align-items: flex-end;
    border-radius: 14px;
    background:
        linear-gradient(
            to top,
            rgba(18, 38, 58, 0.82),
            rgba(18, 38, 58, 0.04)
        ),
        linear-gradient(
            135deg,
            #b6c9d9,
            #607d96
        );
    padding: 16px;
}

.summary-room-image span {
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
}

.summary-room strong,
.summary-room span {
    display: block;
}

.summary-room > div:last-child span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.83rem;
}

.summary-list {
    display: grid;
}

.summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
}

.summary-list dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.summary-list dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

.summary-message {
    margin-top: 20px;
    border-radius: 13px;
    background-color: var(--green-light);
    color: var(--green);
    padding: 15px;
}

.summary-message p {
    margin-top: 4px;
    font-size: 0.82rem;
}

.help-card h3 {
    margin-bottom: 8px;
}

.help-card p {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.help-card a {
    color: var(--primary);
    font-weight: 800;
}


/* ===========================
   FOOTER
=========================== */

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--muted);
    padding: 24px 40px;
    font-size: 0.82rem;
}


/* ===========================
   ACCESSIBILITY
=========================== */

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
}

.workspace-option input:focus-visible + .workspace-option-content {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
}

.time-slot input:focus-visible + span {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
}


/* ===========================
   RESPONSIVE DESIGN
=========================== */

@media (max-width: 1100px) {
    .booking-layout {
        grid-template-columns: 1fr;
    }

    .summary-panel {
        position: static;
    }
}

@media (max-width: 850px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 18px 20px;
    }

    .brand {
        margin-bottom: 18px;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }

    .nav-item {
        flex-shrink: 0;
    }

    .sidebar-footer {
        display: none;
    }

    .app-container {
        margin-left: 0;
    }

    .topbar {
        padding: 18px 24px;
    }

    main {
        padding: 28px 24px 60px;
    }

    footer {
        padding: 24px;
    }
}

@media (max-width: 680px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .booking-panel {
        padding: 24px 18px;
    }

    .workspace-options,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
    }

    footer {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .time-slots {
        grid-template-columns: 1fr;
    }
}