:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --ghost-color: #64748b;
    --ghost-hover-bg: #f1f5f9;
    --focus-ring: #bfdbfe;

    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --success-border: #a7f3d0;

    --alert-bg: #fffbeb;
    --alert-text: #92400e;
    --alert-border: #fde68a;

    --info-bg: #eff6ff;
    --info-text: #1e40af;
    --info-border: #bfdbfe;
}

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

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

main.container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 20px 40px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: relative;
}

/* Progress Bar */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 12px 20px;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#progress-container.hidden {
    display: none;
}

#progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    transition: width 0.4s ease-out;
    border-radius: 4px;
}

/* Main typography & utilites */
.hidden {
    display: none !important;
}

.screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding-top: 10px;
}

.screen.active {
    opacity: 1;
    transform: translateY(0);
}

/* Compensate for fixed progress bar on quiz screens */
#screen-1,
#screen-2,
#screen-3,
#screen-4,
#screen-5,
#screen-6,
#screen-7,
#screen-8,
#screen-9,
#screen-10,
#screen-11 {
    padding-top: 50px;
}

.title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.question {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
    color: var(--text-primary);
}

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

/* Proof Card styling */
.proof-card {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 16px;
    background-image: url('fondo-card.webp');
    /* The user will name their image file to this */
    background-size: cover;
    background-position: center;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.proof-card-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    width: auto;
    max-width: 85%;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.proof-icon {
    width: 28px;
    height: 28px;
    background: #62a342;
    /* Matching the green icon in the image */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.proof-icon svg {
    width: 16px;
    height: 16px;
    color: white;
}

.proof-text {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
}

.proof-text strong {
    font-weight: 700;
}

.help-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: -16px;
    margin-bottom: 24px;
    background: var(--info-bg);
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid var(--info-border);
}

/* Interactive elements */
.btn {
    width: 100%;
    min-height: 56px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: transparent;
    color: var(--ghost-color);
    min-height: 48px;
    font-size: 15px;
    margin-top: 16px;
}

.btn-ghost:hover {
    background: var(--ghost-hover-bg);
    color: var(--text-primary);
}

.my-top {
    margin-top: 40px;
}

.mt-auto {
    margin-top: auto;
}

.mt-4 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 24px;
}

.text-center {
    text-align: center;
}

/* Option Buttons */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-option {
    width: 100%;
    min-height: 56px;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.btn-option .icon {
    font-size: 22px;
    margin-right: 14px;
    flex-shrink: 0;
}

.btn-option .text {
    flex: 1;
}

.btn-option:hover {
    border-color: var(--primary-color);
    background-color: var(--info-bg);
}

.btn-option:active {
    transform: scale(0.98);
    background-color: #e0e7ff;
}

.btn-option.selected {
    border-color: var(--primary-color);
    background-color: var(--info-bg);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

/* Grid options for provinces */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-option-grid {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-option-grid:hover {
    border-color: var(--primary-color);
    background-color: var(--info-bg);
}

.btn-option-grid:active {
    transform: scale(0.97);
}

/* Start screen specifics */
.time-estimate {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 32px;
    width: max-content;
}

.benefits {
    list-style: none;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.benefits li {
    display: flex;
    align-items: flex-start;
    font-size: 15px;
    color: var(--text-primary);
}

.benefits li .icon {
    margin-right: 12px;
    font-size: 18px;
}

.legal-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 16px;
}

/* Processing Screen */
.processing {
    justify-content: center;
    align-items: center;
}

.loader-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circular-loader {
    width: 64px;
    height: 64px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.processing-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

/* Result and Form Screens */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
}

.alert.highlight {
    background-color: var(--alert-bg);
    color: var(--alert-text);
    border: 1px solid var(--alert-border);
}

.alert.info {
    background-color: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}

.trust-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 20px;
}

.icon-lock {
    margin-right: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-group .readonly-input {
    background-color: #f8fafc;
    color: var(--text-secondary);
    cursor: default;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▼";
    font-size: 12px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

.error-msg {
    color: #dc2626;
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
}

/* Confirmation Screen */
.success-icon {
    font-size: 48px;
    margin: 20px auto;
    width: 80px;
    height: 80px;
    background-color: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success-text);
}

.next-steps-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
}

.subtitle-small {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.steps-list li {
    display: flex;
    align-items: flex-start;
    font-size: 15px;
}

.steps-list li .icon {
    font-size: 20px;
    margin-right: 12px;
}

.strong {
    font-weight: 600;
}