/* 
 * Era Uma Vez - Frontend Forms CSS
 * Design Premium, Minimalista, Mobile-first
 */

/* Shared outer wrapper — centers content and enforces 1600px max on desktop */
.era-wrapper {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px;
    box-sizing: border-box;
}

/* Stand-alone form container (used by contact form etc.) */
.era-form-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    padding: 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #334155;
}

.era-wizard-container {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 40px auto;
    max-width: 1600px;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* Step 1 Mode (No sidebar) */
.era-wizard-container.is-step-1 .era-wizard-sidebar {
    display: none;
}
.era-wizard-container.is-step-1 .era-wizard-content {
    flex: 1 1 100%;
}

@media (min-width: 768px) {
    .era-wizard-container {
        flex-direction: row;
        min-height: auto;
    }
}

/* Sidebar */
.era-wizard-sidebar {
    background: #8F1AB2; /* Escolinha Purple */
    background: linear-gradient(135deg, #8F1AB2 0%, #38B9EF 100%);
    color: white;
    padding: 20px 16px;
    position: relative;
    overflow: hidden;
    flex: 0 0 220px;
}

@media (min-width: 768px) {
    .era-wizard-sidebar {
        padding: 24px 20px;
    }
}

.era-sidebar-bg {
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.era-sidebar-bg::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -80px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.era-wizard-steps {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .era-wizard-steps {
        flex-direction: column;
        gap: 16px;
    }
}

.era-step {
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.era-step.active, .era-step.completed {
    opacity: 1;
}

.step-num {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.era-step.active .step-num {
    background: #ffffff;
    color: #8F1AB2;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.era-step.completed .step-num {
    background: transparent;
    border-color: #38B9EF;
    color: transparent;
    position: relative;
}

.era-step.completed .step-num::after {
    content: '✓';
    color: #38B9EF;
    position: absolute;
    font-size: 16px;
}

.step-text {
    display: none;
    flex-direction: column;
}

@media (min-width: 768px) {
    .step-text {
        display: flex;
    }
}

.step-text span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.step-text strong {
    font-size: 15px;
    font-weight: 600;
    margin-top: 2px;
}

/* Content Area */
.era-wizard-content {
    flex: 1;
    padding: 30px 20px;
    background: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .era-wizard-content {
        padding: 40px;
    }
}

.era-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.era-form-step {
    display: none;
    animation: eraFadeIn 0.4s ease forwards;
    flex: 1;
}

.era-form-step.active {
    display: block;
}

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

.era-step-header {
    margin-bottom: 30px;
}

.era-step-header h2 {
    font-size: 24px;
    color: #0f172a;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.era-step-header p {
    color: #64748b;
    margin: 0;
    font-size: 15px;
}

/* Form Fields */
.era-field-group {
    margin-bottom: 20px;
}

.era-field-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 640px) {
    .era-field-row {
        flex-direction: row;
        gap: 20px;
    }
    .era-col {
        flex: 1;
    }
}

.era-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #334155;
}

.era-form .required {
    color: #ef4444;
}

.era-form input[type="text"],
.era-form input[type="email"],
.era-form input[type="text"],
.era-form input[type="email"],
.era-form input[type="tel"],
.era-form input[type="date"],
.era-form select,
.era-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
    color: #0f172a;
    transition: all 0.2s;
    background: #f8fafc;
    font-family: inherit;
}

.era-form input:focus,
.era-form select:focus,
.era-form textarea:focus {
    border-color: #8F1AB2;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(143, 26, 178, 0.1);
}

.era-form .error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    animation: eraShake 0.4s ease-in-out;
}

@keyframes eraShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.era-error-msg {
    color: #ef4444;
    font-size: 13px;
    margin-top: 5px;
    display: block;
    animation: eraFadeIn 0.3s;
}

/* Radios and Checkboxes */
.era-conditional-block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.era-radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.era-radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.era-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.era-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: normal !important;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.era-checkbox-label:hover {
    background: #f1f5f9;
}

.era-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
}

.era-checkbox-label span {
    font-size: 14px;
    line-height: 1.5;
}

/* UI Elements */
.era-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

.era-suggestion-box {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #047857;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.era-suggestion-box::before {
    content: '💡';
}

.era-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.era-summary-box h4 {
    margin: 0 0 15px 0;
    color: #0f172a;
}

.era-summary-box p {
    margin: 8px 0;
    font-size: 14px;
}

.era-alert-info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    color: #1e3a8a;
    font-size: 14px;
}

/* Footer & Buttons */
.era-wizard-footer {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 30px;
}

.era-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.era-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.era-btn-primary {
    background: linear-gradient(135deg, #8F1AB2 0%, #8B1AB0 100%) !important;
    color: #ffffff !important;
    margin-left: auto;
    border-radius: 25px !important;
    padding: 12px 30px;
    box-shadow: 0 4px 15px rgba(139, 26, 176, 0.3) !important;
    border: none !important;
}

.era-btn-primary:hover {
    background: #8B1AB0 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 26, 176, 0.5) !important;
}

.era-btn-secondary {
    background: #38B9EF !important;
    color: #ffffff !important;
    border-radius: 25px !important;
    border: none !important;
}

.era-btn-secondary:hover {
    background: #2ea7db !important;
    color: #ffffff !important;
}

.era-btn-outline {
    background: transparent !important;
    color: #64748b !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 25px !important;
}

.era-btn-outline:hover {
    background: #f8fafc !important;
    color: #334155 !important;
    border-color: #94a3b8 !important;
}

.era-btn-submit {
    background: linear-gradient(135deg, #FEB202 0%, #FEDD03 100%) !important;
    color: #8F1AB2 !important;
    margin-left: auto;
    border-radius: 25px !important;
    padding: 12px 30px;
    box-shadow: 0 4px 15px rgba(254, 178, 2, 0.3) !important;
    border: none !important;
}

.era-btn-submit:hover {
    background: #FEDD03 !important;
    color: #8F1AB2 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 178, 2, 0.5) !important;
}

.era-btn-whatsapp {
    background: #25D366 !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s;
}

.era-btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Messages */
.era-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.era-form-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Success State */
.era-success-state {
    text-align: center;
    padding: 40px 20px;
}

.era-success-icon {
    width: 80px;
    height: 80px;
    background: #38B9EF;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px auto;
}

.era-success-state h2 {
    color: #0f172a;
    font-size: 28px;
    margin-bottom: 10px;
}

.era-ref-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 20px;
    border-radius: 8px;
    margin: 30px auto;
    max-width: 300px;
}

.era-ref-label {
    display: block;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 5px;
}

.era-ref-number {
    font-size: 24px;
    color: #8F1AB2;
    letter-spacing: 1px;
}

/* Floating Action Button */
.era-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.era-fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #8F1AB2;
    background: linear-gradient(135deg, #8F1AB2 0%, #8B1AB0 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 26, 176, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.era-fab-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 26, 176, 0.6);
}

.era-fab-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 300px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    padding: 20px;
    animation: eraFabFadeIn 0.3s ease;
}

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

.era-fab-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.era-fab-link {
    display: block;
    text-align: center;
    padding: 12px;
    background: #f9f0ff;
    border: 1px solid rgba(143, 26, 178, 0.2);
    border-radius: 8px;
    color: #8F1AB2;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.era-fab-link:hover {
    background: linear-gradient(135deg, #8F1AB2 0%, #38B9EF 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(143, 26, 178, 0.2);
}

.era-fab-menu hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px dashed #e2e8f0;
}

.era-fab-contact h4 {
    margin: 0 0 15px 0;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.era-fab-contact input,
.era-fab-contact textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
}

.era-fab-contact input:focus,
.era-fab-contact textarea:focus {
    background: #ffffff;
    border-color: #8F1AB2;
    box-shadow: 0 0 0 3px rgba(143, 26, 178, 0.1);
}

.era-fab-submit {
    width: 100%;
    padding: 14px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    transition: all 0.2s;
}

.era-fab-submit:hover {
    transform: translateY(-2px);
    background: #1EBE5D;
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

/* Frontend Admin Panel */
.era-frontend-dashboard {
    background: #f8fafc;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 30px;
    font-family: inherit;
    margin: 40px auto;
    border: 1px solid #e2e8f0;
    max-width: 1600px;
    width: 100%;
}

.era-fd-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #8F1AB2;
    padding-bottom: 15px;
}

.era-fd-header h2 {
    margin: 0;
    color: #8F1AB2;
    font-size: 28px;
    font-weight: 800;
}

.era-fd-header p {
    margin: 5px 0 0 0;
    color: #64748b;
}

.era-fd-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.era-fd-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.era-fd-tab-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.era-fd-tab-btn.active {
    background: #8F1AB2;
    color: #fff;
    box-shadow: 0 4px 10px rgba(143, 26, 178, 0.2);
}

.era-fd-tab-content {
    display: none;
    animation: eraFadeIn 0.3s ease;
}

.era-fd-tab-content.active {
    display: block;
}

.era-fd-empty {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
}

.era-fd-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.era-fd-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.era-fd-table th {
    background: #f1f5f9;
    color: #334155;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.era-fd-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 14px;
    color: #475569;
}

.era-fd-row:hover td {
    background: #f8fafc;
}

.era-fd-date {
    color: #94a3b8;
    font-size: 13px;
}

.era-fd-wa-link {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
}
.era-fd-wa-link:hover {
    text-decoration: underline;
}

.era-fd-badge {
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.era-fd-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.era-fd-status-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 13px;
    outline: none;
}
.era-fd-status-select:focus {
    border-color: #8F1AB2;
}

.era-fd-btn-update {
    background: #8F1AB2;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}
.era-fd-btn-update:hover:not(:disabled) {
    background: #6b1285;
    transform: scale(1.05);
}
.era-fd-btn-update:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    /* Frontend Dashboard */
    .era-frontend-dashboard {
        padding: 15px;
        margin: 20px 0;
    }
    
    .era-fd-header h2 {
        font-size: 24px;
    }
    
    .era-fd-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding-bottom: 5px;
    }
    
    .era-fd-tabs::-webkit-scrollbar {
        height: 4px;
    }
    .era-fd-tabs::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .era-fd-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 14px;
        text-align: center;
    }
    
    .era-fd-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .era-fd-btn-update {
        width: 100%;
        margin-top: 5px;
    }

    /* Floating Action Button */
    .era-fab-container {
        bottom: 20px;
        right: 20px;
    }

    .era-fab-btn {
        width: 50px;
        height: 50px;
    }

    .era-fab-menu {
        bottom: 65px;
        right: 0;
        width: calc(100vw - 40px); /* Fill screen width minus margins */
        max-width: 300px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .era-fd-tab-btn {
        flex: 1 1 100%;
    }
}
