/* ============================================
   VARIÁVEIS E ESTILOS BASE
============================================ */
:root {
    --color-primary: #22B712;
    --color-primary-dark: #1DA10E;
    --color-secondary: #F1C500;
    --color-error: #F44336;
    --color-text: #161E20;
    --color-text-light: #32484D;
    --color-text-muted: #666666;
    --color-border: #E0E0E0;
    --color-background: #FFFFFF;
    --color-progress-bg: #F2F2F2;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --font-main: 'Montserrat', sans-serif;
    --font-secondary: 'Jost', sans-serif;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ============================================
   RESET E ESTILOS GERAIS DO FORMULÁRIO
============================================ */
.olly-olly-form-container {
    max-width: 500px;
    margin: 0 auto;
    font-family: var(--font-main);
}

.form-step {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
}

/* Títulos e textos */
.step-title-wrapper {
    margin-bottom: 40px;
    text-align: center;
}

.step-title {
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    color: var(--color-text);
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.step-subtitle {
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-light);
    margin: 0 auto;
    max-width: 430px;
}

/* Grupos de formulário */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 8px;
    text-align: left;
}

.form-label::after {
    content: '*';
    color: var(--color-error);
    margin-left: 4px;
}

/* Campos de entrada */
.form-control {
    width: 100%;
    height: 56px;
    padding: 16px 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    font-size: 16px;
    color: var(--color-text);
    background: var(--color-background);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(34, 183, 18, 0.1);
}

.form-control::placeholder {
    color: #9E9E9E;
    font-weight: 400;
}

.form-control.error {
    border-color: var(--color-error);
    background-color: rgba(244, 67, 54, 0.02);
    animation: shake 0.5s ease-in-out;
}

/* Texto de consentimento */
.consent-text {
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 40px;
    text-align: center;
}

/* Mensagens de validação */
.form-hint {
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--color-error);
    margin-top: 6px;
    min-height: 18px;
    text-align: left;
}

/* ============================================
   BOTÕES DE NAVEGAÇÃO
============================================ */
.form-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    gap: 16px;
}

/* Botão primário (Next) */
.btn-next {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    height: 56px;
    padding: 16px 24px;
    background-color: var(--color-primary)!important;
    border: 1px solid transparent!important;
    border-radius: var(--border-radius)!important;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 16px;
    color: #FFFFFF!important;
    cursor: pointer;
    transition: var(--transition);
    gap: 10px;
    flex-shrink: 0;
}

.btn-next:hover {
    background-color: var(--color-primary-dark)!important;;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 183, 18, 0.2)!important;;
}

.btn-next:active {
    transform: translateY(0);
}

.btn-next:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 183, 18, 0.3);
}

.btn-next.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-next.loading .btn-icon svg {
    animation: spin 1s linear infinite;
}

/* Botão secundário (Back) */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background-color: transparent!important;
    border: 1px solid transparent!important;;
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 14px;
    color: #093317!important;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    height: 56px;
}

.btn-back:hover {
    color: var(--color-primary)!important;
    background-color: rgba(9, 51, 23, 0.05)!important;
}

.btn-back:active {
    transform: translateY(1px);
}

.btn-back:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(9, 51, 23, 0.2);
}

/* ============================================
   INDICADOR DE PROGRESSO
============================================ */
.progress-indicator {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--color-progress-bg);
    width: 100%;
    position: relative;
}

.progress-line-container {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 1;
    background-color: transparent;
}

.progress-line {
  position: absolute;
    top: 5px;
    left: 0px;
    right: 20px;
    height: 4px;
    background-color: var(--color-progress-bg);
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
}

.progress-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--color-secondary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.progress-dots {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 3;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-progress-bg);
    transition: var(--transition);
    position: relative;
}

.progress-dot.active {
    background-color: var(--color-secondary);
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(241, 197, 0, 0.2);
    animation: pulseActive 2s infinite;
}

.progress-dot.completed {
    background-color: var(--color-secondary);
}

/* ============================================
   ESTILOS ESPECÍFICOS DO STEP 1
============================================ */
.step-1 .form-actions {
    justify-content: center;
}

/* ============================================
   ESTILOS ESPECÍFICOS DO STEP 2
============================================ */
.step-2 .form-actions {
    justify-content: space-between;
}

/* ============================================
   MODAL
============================================ */
#olly-olly-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

#olly-olly-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

#olly-olly-modal .modal-container {
    position: relative;
    top:20%;
    max-width: 720px;
    width: 90%;
    margin: auto;
    background: white;
    border-radius: 12px;
    padding: 30px;
    z-index: 100000;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

#olly-olly-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 100001;
}

#olly-olly-modal .modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

#olly-olly-modal .modal-loader {
    text-align: center;
    padding: 40px 0;
}

#olly-olly-modal .loader-spinner {
    margin: 0 auto 20px;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#olly-olly-modal .modal-error {
    text-align: center;
    padding: 30px 20px;
}

#olly-olly-modal .error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

#olly-olly-modal .btn-retry,
#olly-olly-modal .btn-close {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin: 5px;
}

#olly-olly-modal .btn-retry {
    background: var(--color-primary);
    color: white;
    border: none;
}

#olly-olly-modal .btn-retry:hover {
    background: var(--color-primary-dark);
}

#olly-olly-modal .btn-close {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

#olly-olly-modal .btn-close:hover {
    background: #e9e9e9;
}

body.modal-open {
    overflow: hidden !important;
}

/* Formulário dentro do modal */
.modal-form .olly-olly-form-container {
    max-width: 100%;
    padding: 0;
}

.modal-form .step-title-wrapper,
.modal-form .form-group,
.modal-form .consent-text,
.modal-form .progress-indicator {
    text-align: left;
}

.modal-form .step-title,
.modal-form .step-subtitle {
    text-align: left;
}

.modal-form .step-subtitle {
    margin-left: 0;
    margin-right: auto;
}

.modal-form .form-actions.step-1-actions {
    justify-content: flex-start;
}

.modal-form .form-actions.step-2-actions {
    justify-content: flex-start;
}

.modal-form .btn-back {
    margin-right: 10px;
}

.modal-form .btn-step-2 {
    margin-left: 10px;
}

/* ============================================
   MENSAGEM DE SUCESSO
============================================ */
.thank-you-message {
    text-align: center;
    padding: 40px 20px;
}

.thank-you-content {
    max-width: 400px;
    margin: 0 auto;
}

.thank-you-icon {
    margin-bottom: 24px;
}

.thank-you-icon svg {
    display: block;
    margin: 0 auto;
}

.thank-you-title {
    font-weight: 700;
    font-size: 32px;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.thank-you-text {
    font-size: 16px;
    color: var(--color-text-light);
    margin-bottom: 32px;
    line-height: 1.6;
}

.restart-form {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--color-primary)!important;
    color: white!important;
    border: none!important;
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.restart-form:hover {
    background-color: var(--color-primary-dark);
}

/* ============================================
   ANIMAÇÕES
============================================ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes pulseActive {
    0% { box-shadow: 0 0 0 0 rgba(241, 197, 0, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(241, 197, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(241, 197, 0, 0); }
}

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

/* ============================================
   RESPONSIVIDADE
============================================ */
@media (max-width: 768px) {
    .step-title {
        font-size: 28px;
        line-height: 36px;
    }
    
    .step-subtitle {
        font-size: 13px;
        padding: 0 20px;
    }
    
    .form-control {
        height: 52px;
        padding: 14px 18px;
    }
    
    .btn-next, .btn-back {
        width: 100%;
        max-width: 200px;
        height: 52px;
        padding: 14px 20px;
    }
    
    .consent-text {
        padding: 0 20px;
        font-size: 11px;
    }
    
    .progress-indicator {
        margin-top: 32px;
        padding-top: 32px;
    }
    
    .progress-line {
        left: 16px;
        right: 16px;
        height: 3px;
    }
    
    .progress-line-container {
        height: 3px;
    }
    
    .progress-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Modal mobile */
    .modal-form .step-title {
        font-size: 28px;
        line-height: 36px;
    }
    
    .modal-form .step-subtitle {
        font-size: 14px;
    }
    
    .modal-form .consent-text {
        font-size: 11px;
    }
    
    /* Ajustes dos botões no mobile */
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .step-1 .form-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .step-2 .form-actions {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .modal-form .form-actions.step-2-actions {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .step-title {
        font-size: 24px;
        line-height: 32px;
    }
    
    .step-title-wrapper {
        margin-bottom: 32px;
    }
    
    .progress-indicator {
        margin-top: 28px;
        padding-top: 28px;
    }
    
    .progress-dot {
        width: 8px;
        height: 8px;
    }
    
    .progress-dot.active {
        transform: scale(1);
    }
    
    .progress-line {
        left: 14px;
        right: 14px;
    }
    
    .thank-you-title {
        font-size: 28px;
    }
    
    .thank-you-text {
        font-size: 14px;
    }
    
    .modal-form .step-title {
        font-size: 24px;
    }
}

/* ============================================
   ACESSIBILIDADE
============================================ */
.form-control:focus-visible,
.btn-next:focus-visible,
.btn-back:focus-visible,
.restart-form:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}