/* Survey Form — Typeform-style */

:root {
    --accent: #FF5A00;
    --accent-hover: #e65100;
    --bg: #fafafa;
    --card-bg: #ffffff;
    --text-primary: #1f1f1f;
    --text-secondary: #7a7a7a;
    --text-muted: #b0b0b0;
    --border: #e0e0e0;
    --border-hover: #c0c0c0;
    --success: #00C853;
    --error: #FF3B30;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

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

[x-cloak] {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--border);
    z-index: 100;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.4s ease;
    border-radius: 0 2px 2px 0;
}

/* Logo */
.logo {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
    padding: 24px 0 0;
}

/* Survey App Container */
#survey-app {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Question Slides */
.question-slide,
.thanks-slide,
.error-slide {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-primary);
}

h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.question-number {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.help-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Rating Selector (1-10) */
.rating-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 24px 0;
}

.rating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card-bg);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-btn:hover,
.rating-btn.hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
}

.rating-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: scale(1.1);
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding: 0 4px;
}

/* CSAT — увеличенные кружки */
.rating-btn-lg {
    width: 56px;
    height: 56px;
    font-size: 18px;
    font-weight: 600;
}

/* Text Input */
.text-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-primary);
    background: var(--card-bg);
    resize: vertical;
    transition: border-color var(--transition);
    margin: 16px 0;
    min-height: 120px;
}

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

.text-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Choice Buttons */
.choice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.choice-btn:hover {
    border-color: var(--accent);
    background: #fff5f0;
}

.choice-btn.active {
    border-color: var(--accent);
    background: #fff5f0;
    color: var(--accent);
    font-weight: 500;
}

/* "Другое" text input */
.other-text-wrapper {
    margin-top: 12px;
    padding: 0 4px;
}

.other-text-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-primary);
    background: #fff5f0;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.other-text-input::placeholder {
    color: var(--text-muted);
}

.other-text-input:focus {
    outline: none;
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.1);
}

/* Checkbox icon for multichoice */
.checkbox-icon {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.checkbox-icon.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-icon.checked::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Max choices hint */
.max-choices-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

/* Disabled multichoice option */
.choice-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border);
    background: var(--bg);
}

.choice-btn.disabled:hover {
    border-color: var(--border);
    background: var(--bg);
}

/* Country Select */
.country-select-wrapper {
    margin: 20px 0;
}

.country-select-wrapper .ss-main {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    min-height: 52px;
    background: var(--card-bg);
}

.country-select-wrapper .ss-main:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.1);
}

.country-select-wrapper .ss-content {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 300px;
}

.country-select-wrapper .ss-search input {
    font-family: inherit;
    font-size: 15px;
    padding: 10px 12px;
}

.country-select-wrapper .ss-option {
    padding: 10px 14px;
    font-size: 15px;
}

.country-select-wrapper .ss-option .fi {
    margin-right: 8px;
    font-size: 18px;
    vertical-align: middle;
}

.country-select-wrapper .ss-option:hover,
.country-select-wrapper .ss-option.ss-highlighted {
    background: #fff5f0;
    color: var(--accent);
}

/* Location wrapper */
.location-wrapper {
    margin: 20px 0;
}

/* Location confirm card */
.location-confirm-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.location-confirm-text {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.5;
}

.location-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-yes-btn,
.confirm-no-btn {
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.confirm-yes-btn {
    background: var(--accent);
    color: #fff;
}

.confirm-yes-btn:hover {
    background: var(--accent-hover);
}

.confirm-no-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.confirm-no-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Location edit fields */
.location-edit {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.location-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.location-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-field .ss-main {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    min-height: 52px;
    background: var(--card-bg);
}

.location-field .ss-main:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.1);
}

.location-field .ss-content {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 300px;
}

.location-field .ss-search input {
    font-family: inherit;
    font-size: 15px;
    padding: 10px 12px;
}

.location-field .ss-option {
    padding: 10px 14px;
    font-size: 15px;
}

.location-field .ss-option .fi {
    margin-right: 8px;
    font-size: 18px;
    vertical-align: middle;
}

.location-field .ss-option:hover,
.location-field .ss-option.ss-highlighted {
    background: #fff5f0;
    color: var(--accent);
}

.city-autocomplete-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-primary);
    background: var(--card-bg);
    transition: border-color var(--transition);
}

.city-autocomplete-input::placeholder {
    color: var(--text-muted);
}

.city-autocomplete-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.1);
}

/* Google Places autocomplete dropdown styling */
.pac-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
    margin-top: 4px;
}

.pac-item {
    padding: 10px 14px;
    font-size: 15px;
    cursor: pointer;
    border-top: 1px solid var(--border);
}

.pac-item:hover {
    background: #fff5f0;
}

.pac-item-query {
    font-size: 15px;
    color: var(--text-primary);
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 16px;
}

.next-btn,
.prev-btn {
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.next-btn {
    background: var(--accent);
    color: #fff;
    margin-left: auto;
}

.next-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.next-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.prev-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.prev-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Thanks Slide */
.thanks-slide {
    text-align: center;
}

.thanks-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.thanks-slide h1 {
    margin-bottom: 12px;
}

.thanks-slide p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Error Slide */
.error-slide {
    text-align: center;
}

.error-slide h1 {
    color: var(--error);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    #survey-app {
        padding: 32px 16px 48px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .rating-selector {
        gap: 6px;
    }

    .rating-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .rating-btn-lg {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }

    .choice-btn {
        padding: 14px 16px;
        font-size: 15px;
    }

    .next-btn,
    .prev-btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .nav-buttons {
        flex-direction: column-reverse;
    }

    .next-btn {
        width: 100%;
        margin-left: 0;
    }

    .prev-btn {
        width: 100%;
    }

    .location-confirm-buttons {
        flex-direction: column;
    }

    .confirm-yes-btn,
    .confirm-no-btn {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .rating-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .rating-btn-lg {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
}
