:root {
    --accent: #0b3a5b;
    --border_color: #e6e9ef;

    --bg-main: #f8f9fa;
    --bg-form: #ffffff;
    --bg-header: #0b3a5b;
    --bg-light: #e9ecef;
    --text-primary: #212529;
    --text-muted: #6c757d;
    --text-inverted: #ffffff;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;

    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.bg-brand {
    background-color: var(--bg-header) !important;
}

.text-brand {
    color: var(--accent) !important;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

.bg-white {
    background-color: var(--bg-form) !important;
}

.page-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0 auto;
    max-width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 1rem;
    height: 70px;
    position: relative;
    color: var(--text-inverted);
}

.page-header h1 {
    margin-bottom: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    width: 60%;
    text-align: center;
    font-size: 1.75rem;
    z-index: 5;
}

.page-header .back-link,
.theme-btn {
    position: relative;
    z-index: 10;
}

.page-header .back-link {
    text-decoration: none;
    color: var(--text-inverted);
    font-weight: 800;
}

.theme-btn {
    padding: 8px 14px;
    border: 1px solid #ffffff66;
    border-radius: 8px;
    background: #ffffff1a;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .2s, color .25s, border-color .25s;
}

.theme-btn:hover {
    background: #ffffff2a;
    transform: translateY(-2px);
}

.form-description {
    background-color: var(--bg-light) !important;
    color: var(--text-primary);
}

.booking-form {
    background-color: var(--bg-form) !important;
}

.form-label {
    color: var(--text-primary);
}


.form-control,
.form-select {
    background-color: var(--bg-form);
    color: var(--text-primary);
    border-color: var(--border_color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-check-card {
    position: relative;
}

.form-check-card .form-check-input {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1;
}

.form-check-card .form-check-label {
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-form);
    border: 1px solid var(--border_color);
    color: var(--text-primary);
}

.form-check-card .form-check-input:checked+.form-check-label {
    border-color: var(--accent) !important;
    background-color: #f0f5ff;
    box-shadow: 0 0 0 2px rgba(39, 90, 255, 0.1);
}

.form-check-card .form-check-label:hover {
    border-color: var(--accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.room-option .form-check-label {
    padding-left: 50px !important;
}

.duration-selection .form-check-label {
    text-align: center;
    padding: 20px 15px !important;
}

.room-photo img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.foot {
    background: var(--bg-header);
    color: var(--text-inverted);
}

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

.group-invalid {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
    display: none;
}

.group-invalid.show {
    display: block;
}

.gap-2 {
    gap: 0.5rem;
}

.toast-area {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.custom-toast {
    min-width: 220px;
    max-width: 340px;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    color: #fff;
    font-weight: 500;
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.custom-toast.success {
    background: #198754;
}

.custom-toast.error {
    background: #dc3545;
}

.custom-toast.neutral {
    background: #676d71;
}

.custom-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.order-confirmation {
    position: relative;
    margin: 18px auto;
    max-width: 750px;
    background: #fff;
    border: 1px solid var(--border_color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.order-confirmation .order-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-confirmation .order-title {
    font-weight: 700;
    font-size: 1rem;
}

.order-confirmation .order-code {
    font-family: "Courier New", monospace;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.order-confirmation .copy-order-btn {
    background: transparent;
    border: 1px solid var(--border_color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 44px;
    justify-content: center;
    user-select: none;
}

.copy-order-btn .icon {
    font-size: 16px;
    line-height: 1;
}

.copy-order-btn .copied-tooltip {
    font-size: 0.85rem;
    margin-left: 8px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .18s, transform .18s;
}

.copy-order-btn.copied .copied-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid white;
    border-top: 3px solid transparent;
    border-radius: 50%;
    display: none;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#submitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dark-mode {
    --bg-main: #121212;
    --bg-form: #1e1e1e;
    --bg-header: #003657;
    --bg-light: #2c2c2c;
    --border_color: #444;
    --text-primary: #e0e0e0;
    --text-muted: #a0a0a0;
}

.dark-mode .theme-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-inverted);
}

.dark-mode .bg-brand,
.foot {
    background-color: var(--bg-header) !important;
    color: var(--text-inverted);
}

.dark-mode .form-description,
.dark-mode .duration-selection {
    background-color: var(--bg-light) !important;
    color: var(--text-primary);
}

.dark-mode .booking-form {
    background-color: var(--bg-form) !important;
}

.dark-mode .form-label {
    color: var(--text-primary);
}

.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #333;
    color: var(--text-primary);
    border-color: #555;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}

.dark-mode .price {
    color: #007bff !important;
    ;
}

.dark-mode .form-control::placeholder {
    color: var(--text-primary);
    opacity: 1;
}

.dark-mode .form-check-card .form-check-label {
    background: var(--bg-form);
    border: 1px solid var(--border_color);
    color: var(--text-primary);
}

.dark-mode .form-check-card .form-check-input:checked+.form-check-label {
    background-color: #0364a4;
    color: var(--text-inverted);
    border-color: #007bff !important;
}



.dark-mode .form-check-input:checked+.form-check-label .price-option {
    background: #0364a4 !important;
}

.dark-mode .price-option {
    background: #333;
    border-color: #555 !important;
    color: var(--text-primary);
}

.dark-mode .theme-btn {
    border: 1px solid #ffffff66;
    background: #3d3d3d;
    color: #fff;
}

.dark-mode .theme-btn:hover {
    background: #505050;
}

@media (max-width: 768px) {
    .room-option .form-check-label {
        padding-left: 15px !important;
        padding-top: 50px !important;
    }

    .form-check-card .form-check-input {
        top: 15px;
        left: 15px;
    }

    .room-photo {
        margin-bottom: 15px;
    }

    .room-photo img {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .d-flex.justify-content-end {
        justify-content: center !important;
    }

    .gap-2 {
        gap: 1rem;
    }

    .page-header {
        height: auto;
        flex-wrap: wrap;
        padding: 10px;
        justify-content: space-between;
        align-items: center;
    }

    .page-header h1 {
        position: static;
        transform: none;
        order: -2;
        width: 100%;
        font-size: 1.3rem;
        margin-top: 2px;
        margin-bottom: 5px;
        text-align: center;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .page-header .back-link {
        font-size: 0.85rem;
        order: -1;
    }

    .theme-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
        order: 1;
        margin-left: 0;
    }


    .order-confirmation {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .order-confirmation .copy-order-btn {
        width: 100%;
    }
}