/* ==========================================================================
   ProAulas - Sistema de Onboarding Interativo Conectado ao Gestor Pro
   Design System: Dark Glassmorphism, Micro-animações e Alta Conversão
   ========================================================================== */

/* Modal Container & Backdrop */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 12, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.onboarding-overlay.active {
    opacity: 1;
    visibility: visible;
}

.onboarding-modal {
    position: relative;
    width: 100%;
    max-width: 580px;
    background: linear-gradient(165deg, rgba(17, 20, 29, 0.98), rgba(11, 13, 20, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8),
                0 0 50px -10px rgba(214, 11, 81, 0.25);
    overflow: hidden;
    transform: scale(0.94) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.onboarding-overlay.active .onboarding-modal {
    transform: scale(1) translateY(0);
}

/* Modal Glow Decorativo */
.onboarding-modal-glow {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(214, 11, 81, 0.28) 0%, rgba(214, 11, 81, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.onboarding-header {
    position: relative;
    padding: 1.75rem 2rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
}

.onboarding-header-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.onboarding-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ff3377;
    background: rgba(214, 11, 81, 0.15);
    border: 1px solid rgba(214, 11, 81, 0.35);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.onboarding-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #ff3377;
    border-radius: 50%;
    box-shadow: 0 0 8px #ff3377;
}

.onboarding-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.onboarding-close-btn:hover {
    background: rgba(214, 11, 81, 0.2);
    border-color: rgba(214, 11, 81, 0.5);
    color: #fff;
    transform: rotate(90deg);
}

/* Stepper Progress Bar */
.onboarding-stepper {
    padding: 1rem 2rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.onboarding-step-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.onboarding-step-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.onboarding-step-label.active {
    color: #f1f5f9;
}

.onboarding-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.onboarding-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d60b51, #ff2a7a);
    box-shadow: 0 0 12px rgba(214, 11, 81, 0.6);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Body & Steps Container */
.onboarding-body {
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.onboarding-step {
    display: none;
    animation: fadeInStep 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.onboarding-step.active {
    display: block;
}

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

.onboarding-step-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.onboarding-step-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 1.6rem;
}

/* Form Groups & Inputs */
.onboarding-form-group {
    margin-bottom: 1.2rem;
    position: relative;
}

.onboarding-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.45rem;
}

.onboarding-label span.req {
    color: #ff3377;
    margin-left: 2px;
}

.onboarding-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.onboarding-input-icon {
    position: absolute;
    left: 1rem;
    color: #64748b;
    font-size: 1rem;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.onboarding-input,
.onboarding-select,
.onboarding-textarea {
    width: 100%;
    background: rgba(15, 18, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.85rem 1rem 0.85rem 2.85rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    color: #fff;
    transition: all 0.25s ease;
    outline: none;
}

.onboarding-input.no-icon,
.onboarding-select.no-icon {
    padding-left: 1rem;
}

.onboarding-input:focus,
.onboarding-select:focus,
.onboarding-textarea:focus {
    border-color: #d60b51;
    background: rgba(22, 26, 40, 0.95);
    box-shadow: 0 0 0 3px rgba(214, 11, 81, 0.25);
}

.onboarding-input::placeholder,
.onboarding-textarea::placeholder {
    color: #475569;
}

.onboarding-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Chips / Radio Buttons para Alunos */
.onboarding-chips-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.onboarding-chip-option {
    position: relative;
}

.onboarding-chip-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.onboarding-chip-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.6rem;
    background: rgba(15, 18, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.onboarding-chip-option input[type="radio"]:checked + .onboarding-chip-card {
    border-color: #d60b51;
    background: rgba(214, 11, 81, 0.16);
    color: #fff;
    box-shadow: 0 0 14px rgba(214, 11, 81, 0.25);
}

/* Checkbox Tags para Necessidades */
.onboarding-tags-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.onboarding-tag-option {
    position: relative;
}

.onboarding-tag-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.onboarding-tag-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    background: rgba(15, 18, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-tag-option input[type="checkbox"]:checked + .onboarding-tag-label {
    border-color: #d60b51;
    background: rgba(214, 11, 81, 0.15);
    color: #ff5c98;
}

/* Actions & Buttons */
.onboarding-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1.8rem;
}

.onboarding-btn-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #d60b51, #f41b67);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.95rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(214, 11, 81, 0.45);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -5px rgba(214, 11, 81, 0.6);
    background: linear-gradient(135deg, #e6145e, #ff2a7a);
}

.onboarding-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.95rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Feedback & Erros */
.onboarding-error-msg {
    font-size: 0.75rem;
    color: #ff4757;
    margin-top: 0.35rem;
    display: none;
}

.onboarding-form-group.has-error .onboarding-input {
    border-color: #ff4757;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.2);
}

.onboarding-form-group.has-error .onboarding-error-msg {
    display: block;
}

/* Spinner */
.onboarding-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    display: none;
}

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

.onboarding-btn-primary.loading .onboarding-btn-text {
    display: none;
}

.onboarding-btn-primary.loading .onboarding-spinner {
    display: inline-block;
}

/* Tela de Sucesso */
.onboarding-success {
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.onboarding-success-icon {
    width: 68px;
    height: 68px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid #10b981;
    color: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.35);
    animation: pulseSuccess 2s infinite;
}

@keyframes pulseSuccess {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 35px rgba(16, 185, 129, 0.5); }
}

.onboarding-success-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
}

.onboarding-success-desc {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto 1.8rem;
}

.onboarding-wa-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    background: #25d366;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 10px 25px -5px rgba(37, 211, 102, 0.4);
    transition: all 0.25s ease;
}

.onboarding-wa-cta:hover {
    background: #20ba59;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -5px rgba(37, 211, 102, 0.55);
}

.onboarding-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 1.2rem;
}

/* Responsividade */
@media (max-width: 640px) {
    .onboarding-modal {
        border-radius: 20px;
        max-height: 96vh;
    }
    
    .onboarding-header {
        padding: 1.25rem 1.25rem 1rem;
    }
    
    .onboarding-stepper {
        padding: 0.75rem 1.25rem 0.25rem;
    }
    
    .onboarding-body {
        padding: 1.25rem;
    }
    
    .onboarding-grid-2 {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .onboarding-chips-group {
        grid-template-columns: 1fr;
    }
    
    .onboarding-actions {
        flex-direction: column-reverse;
    }
    
    .onboarding-btn-secondary,
    .onboarding-btn-primary {
        width: 100%;
    }
}
