/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00A5A5;
    --primary-dark: #008585;
    --primary-soft: rgba(0, 165, 165, 0.1);
    --bg: #ffffff;
    --card-bg: #f5f5f5;
    --card-hover: #eeeeee;
    --border: #e0e0e0;
    --text: #18181b;
    --text-muted: #71717a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.quiz-header {
    padding: 8px 0 24px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 32px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 16.67%;
}

.progress-text {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Question Card */
.question-card,
.address-card,
.contact-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    text-align: center;
}

.question-subtext {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
    text-align: center;
}

/* Answer Buttons */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card-hover);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px;
}

.answer-btn:hover {
    border-color: var(--primary);
    background: rgba(0, 165, 165, 0.08);
}

.answer-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
}

.answer-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--border);
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.answer-btn.selected .answer-letter {
    background: rgba(255, 255, 255, 0.2);
}

/* Custom Input Row */
.custom-input-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.custom-input {
    flex: 1;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.custom-input::placeholder {
    color: #9ca3af;
}

.custom-input:focus {
    border-style: solid;
    border-color: var(--primary);
    background: var(--card-hover);
}

.custom-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.custom-submit:hover:not(:disabled) {
    background: var(--primary-dark);
}

.custom-submit:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Address Input */
.address-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.address-input {
    width: 100%;
    padding: 16px;
    background: var(--card-hover);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.address-input::placeholder {
    color: #9ca3af;
}

.address-input:focus {
    border-color: var(--primary);
}

/* m² Input */
.sqm-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sqm-label {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sqm-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--card-hover);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
    flex: 1;
}

.sqm-input-wrapper:focus-within {
    border-color: var(--primary);
}

.sqm-input {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.sqm-input::placeholder {
    color: #9ca3af;
}

/* Hide number input spinners */
.sqm-input::-webkit-outer-spin-button,
.sqm-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sqm-input[type=number] {
    -moz-appearance: textfield;
}

.sqm-suffix {
    padding: 14px 16px 14px 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.address-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.address-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.address-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Phone Input */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--card-hover);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary);
}

.phone-prefix {
    padding: 16px 8px 16px 12px;
    background: var(--border);
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.phone-input {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
}

.phone-input::placeholder {
    color: #9ca3af;
}

.contact-submit {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.contact-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.privacy-note {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Results Card */
.results-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.results-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--primary);
}

.results-headline {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.results-subtext {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 28px;
    max-width: 380px;
}

/* Estimate Box */
.estimate-box {
    width: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.estimate-row:last-child {
    border-bottom: none;
}

.estimate-row.highlight {
    background: var(--primary-soft);
    margin: 8px -20px;
    padding: 16px 20px;
    border-radius: 12px;
    border-bottom: none;
}

.estimate-row.highlight + .estimate-row {
    border-top: none;
}

.estimate-label {
    font-size: 14px;
    color: var(--text-muted);
}

.estimate-row.highlight .estimate-label {
    color: var(--text);
    font-weight: 500;
}

.estimate-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.estimate-row.highlight .estimate-value {
    color: var(--primary);
    font-size: 18px;
}

/* Results Benefits */
.results-benefits {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: 12px;
    text-align: left;
}

.benefit-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.benefit-item span {
    font-size: 14px;
    color: var(--text);
}

/* Results Map */
.results-map-container {
    width: 100%;
    margin-bottom: 24px;
}

.results-map {
    width: 100%;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    z-index: 0;
}

/* M2Rent Info Sections */
.info-section {
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
}

.info-section-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 20px;
}

.info-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.info-section-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-item,
.guarantee-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: 10px;
}

.service-item svg,
.guarantee-item svg {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.service-item span,
.guarantee-item span {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

/* Coverage Tags */
.coverage-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.coverage-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Google Review Screenshot */
.google-review-img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.results-cta-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 16px;
}

/* Loading Indicator */
.loading-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 24px;
    background: var(--card-bg);
    border-radius: 16px;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* Error Container */
.error-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
}

.error-text {
    font-size: 15px;
    color: #ef4444;
}

.retry-btn {
    padding: 12px 24px;
    background: var(--card-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Desktop adjustments */
@media (min-width: 640px) {
    .container {
        padding: 24px;
    }

    .quiz-header {
        padding: 12px 0 32px;
    }

    .question-text {
        font-size: 22px;
    }

    .answer-btn {
        padding: 18px;
        font-size: 16px;
    }

    .results-headline {
        font-size: 28px;
    }
}

/* Mobile-specific touch improvements */
@media (max-width: 639px) {
    .answer-btn {
        -webkit-tap-highlight-color: transparent;
    }

    .answer-btn:active {
        transform: scale(0.98);
    }
}

/* Info Screen Card */
.info-screen-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0;
    animation: fadeIn 0.5s ease;
}

.info-screen-headline {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text);
}

.info-screen-body {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 400px;
    margin-bottom: 24px;
}

.info-screen-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--primary-soft);
    border-radius: 16px;
    padding: 20px 32px;
    margin-bottom: 28px;
}

.info-screen-stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.info-screen-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-screen-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
}

.info-screen-continue:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.info-screen-continue:active {
    transform: translateY(0);
}

/* Summary Card */
.summary-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

.summary-headline {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.3;
}

/* Nearby Properties Badge */
.nearby-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--primary-soft);
    border: 1px solid rgba(0, 165, 165, 0.2);
    border-radius: 10px;
    margin-bottom: 16px;
}

.nearby-badge svg {
    color: var(--primary);
    flex-shrink: 0;
}

.nearby-badge span {
    font-size: 13px;
    color: var(--primary-dark);
    font-weight: 500;
    line-height: 1.4;
}

/* Property Summary Box */
.summary-property-box {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.highlight {
    background: var(--primary-soft);
    margin: 8px -20px;
    padding: 14px 20px;
    border-radius: 12px;
    border-bottom: none;
}

.summary-row.highlight + .summary-row {
    border-top: none;
}

.summary-label {
    font-size: 13px;
    color: var(--text-muted);
}

.summary-row.highlight .summary-label {
    color: var(--text);
    font-weight: 500;
}

.summary-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    max-width: 60%;
}

.summary-row.highlight .summary-value {
    color: var(--primary);
    font-size: 17px;
}

/* Managed Street Row */
.summary-row.managed-street {
    background: var(--primary-soft);
    margin: 4px -20px 0;
    padding: 10px 20px;
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.summary-row.managed-street .summary-label {
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 12px;
    width: 100%;
    text-align: center;
}

/* Comparable Listings */
.comparable-listings {
    margin-bottom: 20px;
}

.comparable-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.comparable-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: 10px;
    gap: 8px;
}

.comparable-address {
    font-size: 13px;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comparable-details {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.comparable-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.comparable-source {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
}

/* Concern → Solution Section */
.concern-solution {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 20px;
}

.concern-box,
.solution-box {
    flex: 1;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px;
}

.concern-box {
    border-left: 3px solid #ef4444;
}

.solution-box {
    border-left: 3px solid var(--primary);
}

.concern-label,
.solution-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.concern-label {
    color: #ef4444;
}

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

.concern-text,
.solution-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
}

.solution-content {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.solution-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.solution-list li {
    position: relative;
    padding-left: 16px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.solution-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.solution-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 300;
}

/* Summary Benefits */
.summary-benefits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.summary-benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: 10px;
}

.summary-benefit-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.summary-benefit-item span {
    font-size: 13px;
    color: var(--text);
}

/* Summary CTA Section */
.summary-cta-section {
    margin-top: 8px;
    padding: 24px 20px;
    background: rgba(0, 165, 165, 0.08);
    border: 1.5px solid rgba(0, 165, 165, 0.25);
    border-radius: 12px;
}

.summary-cta-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 12px;
}

.summary-phone-wrapper {
    display: flex;
    align-items: center;
    background: var(--card-hover);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.summary-phone-wrapper:focus-within {
    border-color: var(--primary);
}

.summary-phone-submit {
    width: 100%;
    padding: 16px;
    background: #18181b;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.summary-phone-submit:hover:not(:disabled) {
    background: #27272a;
    transform: translateY(-2px);
}

.summary-phone-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.summary-cta-subtext {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Responsive adjustments for summary card */
@media (max-width: 480px) {
    .concern-solution {
        flex-direction: column;
    }

    .solution-arrow {
        transform: rotate(90deg);
        padding: 4px 0;
    }

    .summary-headline {
        font-size: 20px;
    }
}
