/**
 * Anamnese Álcool - Public Styles
 * Design inspirado no TypeForm com animações e transições suaves
 */

/* Reset e Variáveis */
.anamnese-alcool-container {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e5e7eb;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.anamnese-alcool-container *,
.anamnese-alcool-container *::before,
.anamnese-alcool-container *::after {
    box-sizing: border-box;
}

/* Telas */
.anamnese-screen {
    display: none;
    width: 100%;
    max-width: 700px;
    animation: fadeInUp 0.5s ease-out;
}

.anamnese-screen.active {
    display: block;
}

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

/* ========================================
   TELA DE BOAS-VINDAS
   ======================================== */
.anamnese-welcome {
    text-align: center;
}

.welcome-content {
    background: var(--bg-color);
    border-radius: 24px;
    padding: 60px 50px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.welcome-icon svg {
    width: 40px;
    height: 40px;
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}

.welcome-description {
    font-size: 18px;
    color: var(--text-muted);
    margin: 0 0 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.info-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 30px -5px rgba(102, 126, 234, 0.5);
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px -5px rgba(102, 126, 234, 0.6);
}

.btn-start svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   FORMULÁRIO DE PERGUNTAS
   ======================================== */
.anamnese-form {
    background: var(--bg-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 700px;
}

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

.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Question Slides */
.question-slide {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.question-slide.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-number {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.question-text {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 12px;
    line-height: 1.4;
}

.question-description {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0 0 30px;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.option-item:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.option-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: var(--primary-color);
}

.option-key {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.option-item:hover .option-key,
.option-item.selected .option-key {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.option-label {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.option-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition);
}

.option-check svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.option-item.selected .option-check {
    opacity: 1;
    transform: scale(1);
}

/* Navigation Buttons */
.question-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.btn-prev,
.btn-next,
.btn-finish {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-prev {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.btn-prev:hover {
    background: #e5e7eb;
    color: var(--text-color);
}

.btn-next,
.btn-finish {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    margin-left: auto;
    box-shadow: 0 8px 20px -5px rgba(102, 126, 234, 0.4);
}

.btn-next:hover:not(:disabled),
.btn-finish:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -5px rgba(102, 126, 234, 0.5);
}

.btn-next:disabled,
.btn-finish:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-prev svg,
.btn-next svg,
.btn-finish svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   TELA DE RESULTADO
   ======================================== */
.anamnese-result {
    max-width: 800px;
}

.result-content {
    background: var(--bg-color);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.result-header {
    margin-bottom: 40px;
}

.result-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: resultPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes resultPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-icon svg {
    width: 50px;
    height: 50px;
    color: #fff;
}

.result-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Score Display */
.result-score-display {
    margin-bottom: 40px;
}

.score-chart-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
}

.score-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Description */
.result-description {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 40px;
    padding: 0 20px;
    line-height: 1.7;
}

/* Breakdown Chart */
.result-breakdown {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
}

.result-breakdown h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 20px;
}

.result-breakdown canvas {
    max-height: 250px;
}

/* Recommendation */
.result-recommendation {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 40px;
    text-align: left;
}

.recommendation-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--bg-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendation-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.recommendation-text {
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.6;
}

/* CTA Section */
.result-cta {
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
    margin-bottom: 30px;
}

.result-cta h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px;
}

.result-cta > p {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0 0 30px;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: #25D366;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 10px 30px -5px rgba(37, 211, 102, 0.4);
    animation: ctaPulse 2s infinite;
}

@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 10px 30px -5px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 10px 40px -5px rgba(37, 211, 102, 0.6);
    }
}

.btn-whatsapp:hover {
    background: #20bd5a;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px -5px rgba(37, 211, 102, 0.5);
}

.btn-whatsapp svg {
    width: 24px;
    height: 24px;
}

.btn-restart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-restart svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.result-footer {
    color: var(--text-muted);
    font-size: 14px;
}

.result-footer p {
    margin: 0 0 8px;
    font-weight: 600;
}

.result-footer small {
    display: block;
    font-size: 12px;
    opacity: 0.7;
}

/* ========================================
   NÍVEIS DE RISCO - Cores Específicas
   ======================================== */
.risk-baixo .result-icon { background: #10b981; }
.risk-baixo .result-title { color: #10b981; }

.risk-moderado .result-icon { background: #f59e0b; }
.risk-moderado .result-title { color: #f59e0b; }

.risk-alto .result-icon { background: #f97316; }
.risk-alto .result-title { color: #f97316; }

.risk-critico .result-icon { background: #ef4444; }
.risk-critico .result-title { color: #ef4444; }

.risk-critico .btn-whatsapp {
    animation: urgentPulse 1s infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px -5px rgba(37, 211, 102, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 40px -5px rgba(37, 211, 102, 0.6);
    }
}

/* ========================================
   RESPONSIVO
   ======================================== */
@media (max-width: 768px) {
    .anamnese-alcool-container {
        padding: 16px;
        min-height: auto;
    }

    .welcome-content,
    .anamnese-form,
    .result-content {
        padding: 30px 24px;
        border-radius: 20px;
    }

    .welcome-content h1 {
        font-size: 26px;
    }

    .welcome-description {
        font-size: 16px;
    }

    .welcome-info {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .btn-start {
        padding: 16px 32px;
        font-size: 16px;
    }

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

    .option-item {
        padding: 16px 18px;
    }

    .option-label {
        font-size: 15px;
    }

    .question-navigation {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .btn-prev,
    .btn-next,
    .btn-finish {
        width: 100%;
        justify-content: center;
    }

    .btn-prev {
        margin-left: 0;
    }

    .btn-next,
    .btn-finish {
        margin-left: 0;
    }

    .result-title {
        font-size: 28px;
    }

    .score-chart-container {
        width: 180px;
        height: 180px;
    }

    .score-number {
        font-size: 40px;
    }

    .result-description {
        font-size: 16px;
        padding: 0;
    }

    .result-recommendation {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .btn-whatsapp {
        padding: 16px 28px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .welcome-icon {
        width: 60px;
        height: 60px;
    }

    .welcome-icon svg {
        width: 30px;
        height: 30px;
    }

    .welcome-content h1 {
        font-size: 22px;
    }

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

    .result-icon {
        width: 80px;
        height: 80px;
    }

    .result-icon svg {
        width: 40px;
        height: 40px;
    }

    .result-breakdown {
        padding: 20px 16px;
    }
}

/* ========================================
   ANIMAÇÕES DE LOADING
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Keyboard navigation hint */
.keyboard-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

@media (min-width: 769px) {
    .keyboard-hint {
        display: block;
    }
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 4px;
    font-family: inherit;
}
