/* WeCann Forms Styles - High Specificity */

#wcf-form-container {
    max-width: 650px;
    margin: 0px;
    padding: 0px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Progress Bar */
#wcf-form-container .wcf-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
    padding: 0 10px;
}

/* Linha de fundo (cinza) - sempre visível */
#wcf-form-container .wcf-progress-bar::before {
    content: '';
    position: absolute;
    top: 22px;
    left: calc(25% + 22px);
    width: calc(50% - 44px);
    height: 2px;
    background-color: #e0e0e0;
    z-index: 0;
}

/* Linha de progresso (verde) - cresce conforme avança */
#wcf-form-container .wcf-progress-bar::after {
    content: '';
    position: absolute;
    top: 22px;
    left: calc(25% + 22px);
    width: 0;
    height: 2px;
    background-color: #276868;
    z-index: 0;
    transition: width 0.5s ease;
}

/* Estados de progresso da linha */
#wcf-form-container .wcf-progress-bar.step-1::after {
    width: 0%;
}

#wcf-form-container .wcf-progress-bar.step-2::after {
    width: calc(50% - 44px);
}

/* Indicador de etapa */
#wcf-form-container .wcf-step-indicator {
    text-align: center;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #276868;
}

#wcf-form-container .wcf-step-text {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    letter-spacing: 0.3px;
}

#wcf-form-container .wcf-step-text span {
    color: #276868;
    font-weight: 700;
}

#wcf-form-container .wcf-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    padding: 0 5px;
}

#wcf-form-container .wcf-step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

/* Círculo de fundo - por padrão branco (inativo) */
#wcf-form-container .wcf-step-number::before {
    content: '';
    position: absolute;
    width: 48px;
    height: 48px;
    background-color: white;
    border-radius: 50%;
    z-index: -1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

/* Ícones SVG dentro do step number */
#wcf-form-container .wcf-step-icon {
    position: absolute;
    transition: all 0.3s ease;
}

/* Ícone padrão - cinza quando inativo */
#wcf-form-container .wcf-step-icon.wcf-icon-default {
    opacity: 1;
    transform: scale(1);
    color: #999;
}

#wcf-form-container .wcf-step-icon.wcf-icon-check {
    opacity: 0;
    transform: scale(0);
    color: #FFF;
}

/* Etapa ativa - círculo verde, ícone branco */
#wcf-form-container .wcf-progress-step.active .wcf-step-number::before {
    background-color: #276868;
    border-color: #276868;
    box-shadow: 0 4px 8px rgba(39, 104, 104, 0.3);
}

#wcf-form-container .wcf-progress-step.active .wcf-step-icon.wcf-icon-default {
    color: #FFF;
}

#wcf-form-container .wcf-progress-step.active .wcf-step-number {
    transform: scale(1.1);
}

/* Etapa completada - círculo verde, troca para check branco */
#wcf-form-container .wcf-progress-step.completed .wcf-step-number::before {
    background-color: #276868;
    border-color: #276868;
}

#wcf-form-container .wcf-progress-step.completed .wcf-icon-default {
    opacity: 0;
    transform: scale(0);
}

#wcf-form-container .wcf-progress-step.completed .wcf-icon-check {
    opacity: 1;
    transform: scale(1);
}



/* Form */
#wcf-main-form {
    background: white;
    border-radius: 12px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#wcf-main-form .wcf-step {
    display: none;
}

#wcf-main-form .wcf-step.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

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

#wcf-main-form .wcf-form-title {
    font-size: 26px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Form Groups */
#wcf-main-form .wcf-form-group {
    margin-bottom: 24px;
}

#wcf-main-form .wcf-form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

#wcf-main-form .wcf-required {
    color: #e74c3c;
    margin-left: 3px;
    font-weight: bold;
}

#wcf-main-form .wcf-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #fafafa;
}

#wcf-main-form .wcf-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.6;
}

#wcf-main-form .wcf-input:hover {
    border-color: #c0c0c0;
    background-color: #fff;
}

#wcf-main-form .wcf-input:focus {
    outline: none !important;
    border-color: #276868 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(39, 104, 104, 0.1) !important;
}

#wcf-main-form .wcf-input.error {
    border-color: #e74c3c !important;
    background-color: #fff5f5 !important;
}

#wcf-main-form .wcf-input.error:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1) !important;
}

#wcf-main-form .wcf-error {
    display: none;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
    line-height: 1.4;
}

#wcf-main-form .wcf-error:not(:empty) {
    display: block;
}

/* Placeholder styling */
#wcf-main-form .wcf-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Select customization */
#wcf-main-form select.wcf-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23276868' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

#wcf-main-form select.wcf-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23276868' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    outline: none !important;
    border-color: #276868 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(39, 104, 104, 0.1) !important;
}

/* Buttons */
#wcf-main-form .wcf-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 35px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

#wcf-main-form .wcf-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    font-family: inherit;
}

#wcf-main-form .wcf-btn-primary {
    background: linear-gradient(135deg, #276868 0%, #1f5454 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(39, 104, 104, 0.3);
}

#wcf-main-form .wcf-btn-primary:hover {
    background: linear-gradient(135deg, #1f5454 0%, #1a4848 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 104, 104, 0.4);
    color: #ffffff !important;
}

#wcf-main-form .wcf-btn-primary:active {
    transform: translateY(0);
    color: #ffffff !important;
}

#wcf-main-form .wcf-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #666 !important;
}

#wcf-main-form .wcf-btn-secondary {
    background-color: #f5f5f5;
    color: #555 !important;
    border: 2px solid #e0e0e0;
}

#wcf-main-form .wcf-btn-secondary:hover {
    background-color: #e8e8e8;
    border-color: #c0c0c0;
    color: #333 !important;
}

/* Loading */
#wcf-main-form .wcf-loading {
    text-align: center;
    padding: 50px 20px;
}

#wcf-main-form .wcf-loading p {
    color: #666;
    font-size: 16px;
    margin-top: 10px;
    font-weight: 500;
}

#wcf-main-form .wcf-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #276868;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Success Message */
#wcf-main-form .wcf-success-message {
    text-align: center;
    padding: 50px 20px;
}

#wcf-main-form .wcf-success-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #276868 0%, #1f5454 100%);
    color: white;
    font-size: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    animation: scaleIn 0.6s ease-out;
    box-shadow: 0 8px 24px rgba(39, 104, 104, 0.3);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#wcf-main-form .wcf-success-message h3 {
    color: #2c3e50;
    font-size: 26px;
    margin-bottom: 15px;
    font-weight: 600;
}

#wcf-main-form .wcf-success-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Conditional field animation */
#wcf-main-form #wcf-especialidade-group {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Helper text */
#wcf-main-form .wcf-helper-text {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    #wcf-form-container {
        padding: 15px;
        margin: 20px auto;
    }

    #wcf-main-form {
        padding: 25px 20px;
        border-radius: 8px;
    }

    #wcf-main-form .wcf-form-title {
        font-size: 22px;
        margin-bottom: 25px;
    }

    #wcf-form-container .wcf-progress-bar {
        margin-bottom: 30px;
    }


/* Accessibility */
#wcf-main-form .wcf-input:focus-visible {
    outline: 3px solid #276868 !important;
    outline-offset: 2px;
}

#wcf-main-form .wcf-btn:focus-visible {
    outline: 3px solid #333 !important;
    outline-offset: 2px;
}

/* Focus within form group */
#wcf-main-form .wcf-form-group:focus-within label {
    color: #276868;
}

/* Print styles */
@media print {
    #wcf-form-container .wcf-progress-bar,
    #wcf-main-form .wcf-form-actions {
        display: none;
    }
    
    #wcf-main-form {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Loading state for buttons */
#wcf-main-form .wcf-btn-primary.loading {
    position: relative;
    color: transparent !important;
}

#wcf-main-form .wcf-btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff !important;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}
