* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: url('../assets/images/residence-background-photo.jpg') center/cover no-repeat fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.admin-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.btn-admin {
    padding: 10px 20px;
    background: #5DBDBD;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-admin:hover {
    background: #4DADAD;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.modal {
    background: white;
    border-radius: 8px;
    max-width: 480px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    padding: 30px 40px 35px;
}

.modal h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
}

.modal p {
    color: #666;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #5DBDBD;
}

.form-group input.error {
    border-color: #f44336;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #999;
    font-size: 11px;
    font-style: italic;
}

.form-group small.error {
    color: #f44336;
}

.address-dropdown {
    position: relative;
    margin-bottom: 12px;
}

.address-suggestion {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

/* Clickable suggestions - has hover effect */
.address-suggestion.clickable {
    cursor: pointer;
}

.address-suggestion.clickable:hover {
    background: #5DBDBD;
    color: white;
}

/* Non-clickable suggestions (errors, no results, searching) */
.address-suggestion.no-results,
.address-suggestion.error,
.address-suggestion.searching {
    cursor: default;
    color: #999;
    font-style: italic;
}

.address-suggestion.error {
    color: #f44336;
}

.address-suggestion.searching {
    color: #666;
}

/* Remove hover effect from non-clickable */
.address-suggestion.no-results:hover,
.address-suggestion.error:hover,
.address-suggestion.searching:hover {
    background: transparent;
    color: inherit;
}

.address-suggestion:last-child {
    border-bottom: none;
}

/* Selected state */
.address-suggestion.selected {
    background: #5DBDBD;
    color: white;
}

.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.address-suggestions.show {
    display: block;
}

.address-suggestion {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.address-suggestion:hover,
.address-suggestion.selected {
    background: #5DBDBD;
    color: white;
}

.address-suggestion:last-child {
    border-bottom: none;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    width: 100%;
}

.btn-primary {
    background: #5DBDBD;
    color: white;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: #4DADAD;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.btn-cancel {
    background: transparent;
    color: #5DBDBD;
    padding: 9px 22px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

.btn-cancel:hover {
    text-decoration: underline;
}

.btn-continue {
    background: #5DBDBD;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 22px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

.btn-continue:hover {
    background: #4DADAD;
}

.btn-continue:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.terms {
    font-size: 11.5px;
    color: #666;
    margin-top: 12px;
    line-height: 1.4;
}

.terms a {
    color: #5DBDBD;
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

.consent-text {
    font-size: 14px;
    color: #555;
    margin-top: 15px;
    line-height: 1.8;
    overflow-y: auto;
    padding: 24px 22px;
    background: #fafafa;
    border-radius: 4px;
    border: none;
    flex: 1;
    min-height: 100px;
}

.consent-text p {
    margin-bottom: 18px;
    font-size: 14px;
}

.consent-text p:last-child {
    margin-bottom: 0;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

/* Make contact form section taller and use flexbox */
#contactForm.active {
    display: flex;
    flex-direction: column;
    min-height: 50vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #5DBDBD;
}

.timer {
    background: #ff6b6b;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timer.warning {
    background: #ff9800;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.chat-messages {
    max-height: 600px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot {
    text-align: left;
}

.message.user {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: #5DBDBD;
    color: white;
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: #e0e0e0;
    color: #333;
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input-container input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
}

.chat-input-container button {
    padding: 12px 25px;
    background: #5DBDBD;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.chat-input-container button:hover {
    background: #4DADAD;
}

.chat-input-container button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    display: inline-block;
    padding: 10px 15px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.end-chat-btn {
    width: 100%;
    padding: 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.end-chat-btn:hover:not(:disabled) {
    background: #da190b;
}

.end-chat-btn.disabled,
.end-chat-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.thank-you-container {
    text-align: center;
    padding: 40px 20px;
}

.thank-you-container h2 {
    font-size: 32px;
    color: #5DBDBD;
    margin-bottom: 20px;
}

.thank-you-container p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.thank-you-container .btn {
    max-width: 100%;
    margin: 0 auto;
}

.chat-ended-message {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    animation: fadeIn 0.3s;
}

.option-button {
    padding: 15px 20px;
    background: white;
    color: #333;
    border: 2px solid #5DBDBD;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    line-height: 1.4;
}

.option-button:hover:not(:disabled) {
    background: #5DBDBD;
    color: white;
    transform: translateX(5px);
}

.option-button:disabled {
    cursor: not-allowed;
}

.option-button.selected {
    background: #5DBDBD;
    color: white;
    font-weight: 600;
}
/* Mobile Responsive Styles */
@media only screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .modal {
        padding: 20px 25px;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .modal p {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .admin-nav {
        top: 10px;
        right: 10px;
    }

    .btn-admin {
        padding: 8px 15px;
        font-size: 12px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* 16px prevents iOS zoom */
    }

    .chat-messages {
        max-height: 400px;
        padding: 10px;
        margin-bottom: 12px;
    }

    .message-bubble {
        max-width: 85%;
        padding: 8px 12px;
        font-size: 14px;
    }

    .chat-input-container {
        gap: 8px;
    }

    .chat-input-container input {
        padding: 10px 12px;
        font-size: 16px; /* 16px prevents iOS zoom */
    }

    .chat-input-container button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .option-button {
        padding: 12px 15px;
        font-size: 14px;
    }

    .consent-text {
        padding: 15px;
        font-size: 13px;
        max-height: 150px;
    }

    .chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chat-header h2 {
        font-size: 18px;
    }

    .timer {
        align-self: flex-end;
    }

    .thank-you-container {
        padding: 30px 15px;
    }

    .thank-you-container h2 {
        font-size: 26px;
    }

    .thank-you-container p {
        font-size: 14px;
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media only screen and (max-width: 576px) {
    .modal {
        padding: 15px 20px;
    }

    .modal h2 {
        font-size: 18px;
    }

    .chat-messages {
        max-height: 350px;
    }

    .buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-cancel,
    .btn-continue {
        width: 100%;
    }
}
/* ============================================================
   Questionnaire (replaces the AI chat)
   ============================================================ */
.questionnaire-header {
    margin-bottom: 18px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background: #5DBDBD;
    border-radius: 3px;
    transition: width 0.35s ease;
}

.progress-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.question-text {
    font-size: 22px;
    color: #333;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.question-subtext {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.question-step {
    animation: fadeIn 0.3s;
}

/* Text / input answer inside the questionnaire */
.question-input-group {
    margin-bottom: 16px;
}

.question-input-group input,
.question-input-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.question-input-group input:focus,
.question-input-group textarea:focus {
    outline: none;
    border-color: #5DBDBD;
}

.question-input-group textarea {
    resize: vertical;
    min-height: 90px;
}

.question-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.btn-back {
    background: transparent;
    color: #5DBDBD;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 9px 4px;
}

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

.btn-back[hidden] {
    display: none;
}

.question-nav .btn-next {
    margin-left: auto;
    width: auto;
    min-width: 130px;
}

.question-terms {
    font-size: 11.5px;
    color: #888;
    margin-top: 16px;
    line-height: 1.4;
    text-align: center;
}

.question-terms a {
    color: #5DBDBD;
    text-decoration: none;
}

.question-terms a:hover {
    text-decoration: underline;
}

@media only screen and (max-width: 768px) {
    .question-text {
        font-size: 19px;
    }
}

/* ============================================================
   v2 — backdrop, footer, checkbox, slider, info/text screens
   ============================================================ */

/* Stronger "backlit" vignette behind the modal */
body::before {
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0.28) 0%,
        rgba(0, 0, 0, 0.58) 100%);
}

/* Keep the fixed footer from covering the modal bottom */
body {
    padding-bottom: 48px;
}

/* Fixed terms footer */
.zb-page-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.zb-page-footer a {
    color: #8fe0e0;
    text-decoration: none;
}

.zb-page-footer a:hover {
    text-decoration: underline;
}

/* Optional agreement checkbox */
.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    font-size: 11.5px;
    color: #666;
    line-height: 1.4;
    cursor: pointer;
}

.consent-check input {
    margin-top: 1px;
    width: 15px;
    height: 15px;
    accent-color: #5DBDBD;
    flex-shrink: 0;
    cursor: pointer;
}

.consent-check a {
    color: #5DBDBD;
    text-decoration: none;
}

.consent-check a:hover {
    text-decoration: underline;
}

/* Divider line used between a question's control and its Continue button */
.q-divider {
    border: none;
    border-top: 1px solid #e6e6e6;
    margin: 18px 0;
}

.q-continue {
    margin-top: 2px;
}

/* Slider question */
.slider-question {
    margin: 26px 0 6px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.slider-label {
    font-size: 15px;
    color: #9a9a9a;
    flex: 1;
    transition: color 0.2s, font-weight 0.2s;
}

.slider-label:first-child { text-align: left; }
.slider-label:last-child { text-align: right; }
.slider-label:not(:first-child):not(:last-child) { text-align: center; }

.slider-label.active {
    color: #5DBDBD;
    font-weight: 600;
}

#qSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #d4ecec;
    outline: none;
    cursor: pointer;
}

#qSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #5DBDBD;
    border: 5px solid #fff;
    box-shadow: 0 0 0 1px #5DBDBD, 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

#qSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #5DBDBD;
    border: 5px solid #fff;
    box-shadow: 0 0 0 1px #5DBDBD, 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

/* Info screen body copy */
.question-info-body {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 2px;
}

/* Free-text hint (e.g. SHIFT + ENTER) */
.question-hint {
    font-size: 12px;
    color: #999;
}

.question-hint strong {
    color: #5DBDBD;
    font-weight: 600;
}

/* Borderless underline-style text field inside the questionnaire */
.question-input-group input,
.question-input-group textarea {
    border: none;
    border-radius: 0;
    padding: 6px 2px;
    font-size: 18px;
    color: #333;
}

.question-input-group input::placeholder,
.question-input-group textarea::placeholder {
    color: #b9b9b9;
}

.question-input-group input:focus,
.question-input-group textarea:focus {
    border: none;
    outline: none;
}

.question-input-group input.error,
.question-input-group textarea.error {
    border: none;
    border-bottom: 2px solid #f44336;
}

/* Subtle back link */
.btn-back {
    display: block;
    margin: 12px auto 0;
    background: transparent;
    color: #9a9a9a;
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.btn-back:hover {
    color: #5DBDBD;
    text-decoration: underline;
}
