/**
 * Agência RC Digital - Commercial Diagnostic Form Styles
 * Executive, high-contrast, mobile-first design.
 */

.rc-diagnostic-wrap {
    max-width: 860px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 10px 35px -5px rgba(9, 14, 23, 0.06);
    overflow: hidden;
    position: relative;
}

/* Stepper Header */
.rc-diag-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 1.25rem;
    background: #090e17;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rc-diag-step-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #94a3b8;
    font-size: 0.92rem;
    font-weight: 500;
}

.rc-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.25s ease;
}

.rc-diag-step-indicator.active .rc-step-badge {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.5);
}

.rc-diag-step-indicator.completed .rc-step-badge {
    background: #16a34a;
    color: #ffffff;
}

.rc-diag-step-indicator.active {
    color: #ffffff;
    font-weight: 700;
}

.rc-diag-step-divider {
    flex: 1;
    height: 2px;
    background: #1e293b;
    margin: 0 1rem;
    position: relative;
}

.rc-diag-step-divider.filled {
    background: #0284c7;
}

/* Form Container */
.rc-diag-form {
    padding: 2.25rem 2.25rem 2rem;
}

.rc-diag-panel {
    display: none;
    animation: rcFadeIn 0.3s ease;
}

.rc-diag-panel.active {
    display: block;
}

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

.rc-panel-header {
    margin-bottom: 1.75rem;
}

.rc-panel-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #090e17;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.rc-panel-subtitle {
    font-size: 0.98rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* Step 1: Multi-Selection Cards */
.rc-services-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.rc-service-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    text-align: left;
}

.rc-service-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
    transform: translateY(-2px);
}

.rc-service-card:focus-visible {
    outline: 3px solid #0284c7;
    outline-offset: 2px;
}

.rc-service-card.is-selected {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.rc-card-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #ffffff;
}

.rc-service-card.is-selected .rc-card-checkbox {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.rc-card-checkbox svg {
    display: none;
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

.rc-service-card.is-selected .rc-card-checkbox svg {
    display: block;
}

.rc-card-content {
    flex: 1;
}

.rc-card-label {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 0.2rem;
}

.rc-service-card.is-selected .rc-card-label {
    color: #0369a1;
}

.rc-card-desc {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
}

/* Form Fields (Step 2 & 3) */
.rc-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.rc-field-col-full {
    grid-column: span 2;
}

.rc-field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.15rem;
}

.rc-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.45rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rc-label-hint {
    font-size: 0.78rem;
    font-weight: 400;
    color: #64748b;
}

.rc-input,
.rc-textarea,
.rc-select {
    width: 100%;
    padding: 0.78rem 1rem;
    font-size: 0.96rem;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.rc-input:focus,
.rc-textarea:focus,
.rc-select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.rc-input[aria-invalid="true"],
.rc-textarea[aria-invalid="true"] {
    border-color: #dc2626;
    background: #fef2f2;
}

.rc-textarea {
    resize: vertical;
    min-height: 90px;
}

.rc-char-counter {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 0.25rem;
}

.rc-field-error {
    font-size: 0.8rem;
    color: #dc2626;
    font-weight: 600;
    margin-top: 0.35rem;
    display: none;
}

.rc-field-error.is-visible {
    display: block;
}

/* Conditional Questions Box */
.rc-conditional-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.rc-conditional-box-title {
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0369a1;
    margin: 0 0 1rem 0;
}

/* Pill Options (Buttons) */
.rc-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rc-pill-option {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1.15rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.rc-pill-option:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.rc-pill-option.is-selected {
    background: #090e17;
    border-color: #090e17;
    color: #ffffff;
}

/* Consent Checkbox */
.rc-consent-group {
    margin: 1.5rem 0 1.25rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.rc-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.6;
}

.rc-consent-checkbox {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #0284c7;
    cursor: pointer;
    flex-shrink: 0;
}

.rc-consent-label a {
    color: #0284c7;
    text-decoration: underline;
    font-weight: 600;
}

/* Action Footer */
.rc-diag-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.rc-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.75rem 1.35rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rc-btn-back:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.rc-btn-next,
.rc-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #0284c7;
    border: 1px solid #0369a1;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
    margin-left: auto;
}

.rc-btn-next:hover,
.rc-btn-submit:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

.rc-btn-submit:disabled,
.rc-btn-next:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.rc-btn-submit.is-loading .rc-spinner {
    display: inline-block;
}

.rc-btn-submit.is-loading .rc-btn-text {
    opacity: 0.85;
}

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

/* Success Screen */
.rc-diag-success {
    display: none;
    text-align: center;
    padding: 3rem 2rem 3.5rem;
}

.rc-diag-success.active {
    display: block;
    animation: rcFadeIn 0.35s ease;
}

.rc-success-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.rc-success-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: #090e17;
    margin: 0 0 0.85rem;
}

.rc-success-desc {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.7;
    max-width: 580px;
    margin: 0 auto 2rem;
}

.rc-success-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #16a34a;
    border: 1px solid #15803d;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.95rem 2.25rem;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.3);
    transition: all 0.2s ease;
}

.rc-success-cta:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.4);
    color: #ffffff;
}

.rc-success-note {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 1.25rem;
}

/* Global Alert Error Box */
.rc-global-error {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.rc-global-error.is-visible {
    display: block;
}

/* Honeypot field (fully invisible to humans) */
.rc-hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .rc-diag-stepper {
        padding: 1rem 1.25rem;
    }
    .rc-diag-step-indicator span:not(.rc-step-badge) {
        display: none;
    }
    .rc-diag-form {
        padding: 1.5rem 1.25rem 1.5rem;
    }
    .rc-panel-title {
        font-size: 1.3rem;
    }
    .rc-services-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }
    .rc-fields-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .rc-field-col-full {
        grid-column: span 1;
    }
    .rc-diag-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    .rc-btn-back,
    .rc-btn-next,
    .rc-btn-submit {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

