.onboarding-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.onboarding-modal.is-hidden {
    display: none;
}

.onboarding-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.onboarding-modal-dialog {
    position: relative;
    width: min(520px, 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 31, 52, 0.35);
    background: linear-gradient(165deg, rgba(255, 31, 52, 0.12) 0%, #141414 42%, #080808 100%);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
    padding: 1.6rem;
    animation: modal-in 0.35s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.intro-dialog .intro-slides {
    position: relative;
    min-height: 220px;
}

.intro-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.intro-slide.is-visible {
    display: block;
    opacity: 1;
}

.intro-slide h2 {
    margin-top: 0;
    color: var(--brand-white);
}

.intro-text {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

.intro-dots {
    display: flex;
    gap: 0.45rem;
    justify-content: center;
    margin-top: 1rem;
}

.intro-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
}

.intro-dot.is-active {
    background: var(--brand-red);
    box-shadow: 0 0 10px rgba(255, 31, 52, 0.55);
}

.onboarding-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.consent-actions {
    justify-content: center;
}

.btn-wide {
    min-width: 200px;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
}

.consent-check input {
    margin-top: 0.25rem;
    accent-color: var(--brand-red);
}

.onboarding-main.is-main-hidden {
    display: none;
}

.onboarding-page {
    padding: 4rem 0;
}

.onboarding-wrap {
    max-width: 980px;
}

.onboarding-header p {
    margin: 0 0 0.4rem;
}

.step-tabs {
    margin-top: 1.4rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

.step-tab {
    border: 1px solid #363636;
    background: #111;
    color: #ddd;
    border-radius: 10px;
    padding: 0.65rem 0.7rem;
    cursor: pointer;
}

.step-tab.is-active {
    border-color: rgba(255, 31, 52, 0.8);
    background: rgba(255, 31, 52, 0.15);
}

.step-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.step-panels {
    margin-top: 1rem;
    border: 1px solid #2f2f2f;
    border-radius: 14px;
    padding: 1.2rem;
    background: linear-gradient(180deg, #131313 0%, #0a0a0a 100%);
}

.step-panel {
    display: none;
}

.step-panel.is-active {
    display: block;
}

.grid {
    display: grid;
    gap: 0.9rem;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid .full-row {
    grid-column: 1 / -1;
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #909090;
}

.field.textarea {
    resize: vertical;
    min-height: 88px;
}

.logo-preview-wrap {
    margin-top: 0.65rem;
}

.logo-preview {
    border-radius: 12px;
    border: 1px solid #333;
    object-fit: contain;
    background: #0a0a0a;
}

.logo-preview.is-hidden {
    display: none;
}

.field {
    width: 100%;
    margin-top: 0.3rem;
    border: 1px solid #303030;
    border-radius: 10px;
    background: #0d0d0d;
    color: #f2f2f2;
    padding: 0.7rem 0.9rem;
    font: inherit;
}

.field:focus {
    outline: 2px solid rgba(255, 31, 52, 0.45);
    outline-offset: 1px;
}

.pix-box {
    margin-top: 1rem;
    border: 1px dashed #4a4a4a;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.actions {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
}

.feedback {
    min-height: 1.4rem;
    margin-top: 0.7rem;
    color: #79d894;
}

.feedback.is-error {
    color: #ff7e8c;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--brand-white, #f5f5f5);
}

.panel-lead {
    margin: 0 0 1rem;
}

.panel-lead code {
    font-size: 0.82em;
    padding: 0.12em 0.35em;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}

.integration-cards {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    margin-top: 0.75rem;
}

.integration-cards-erp {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.integration-card {
    text-align: left;
    border: 1px solid #363636;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.integration-card:hover {
    border-color: rgba(255, 31, 52, 0.45);
    background: rgba(255, 31, 52, 0.06);
}

.integration-card.is-selected {
    border-color: rgba(255, 31, 52, 0.95);
    box-shadow: 0 0 0 1px rgba(255, 31, 52, 0.35);
    background: rgba(255, 31, 52, 0.12);
}

.integration-card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 31, 52, 0.95);
    margin-bottom: 0.45rem;
}

.integration-card strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.integration-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted, #999);
    line-height: 1.45;
}

.smtp-fieldset,
.onboarding-fieldset {
    margin: 0;
    padding: 1rem 1.1rem 0.9rem;
    border: 1px solid #363636;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}

.smtp-fieldset legend,
.onboarding-fieldset legend {
    padding: 0 0.45rem;
    font-weight: 600;
    color: #ddd;
}

.step-fieldset {
    margin-top: 1rem;
}

.step-fieldset:first-of-type {
    margin-top: 0.45rem;
}

.subtle-hint {
    margin: 0 0 0.75rem !important;
    font-size: 0.88rem;
}

.visual-upload-grid {
    align-items: start;
}

.favicon-preview-wrap {
    margin-top: 0.65rem;
}

.favicon-preview {
    border-radius: 8px;
    border: 1px solid #333;
    object-fit: contain;
    background: #0a0a0a;
    display: block;
}

.favicon-preview.is-hidden {
    display: none;
}

.logo-preview-wrap-compact {
    margin-top: 0.65rem;
}

.plan-summary-box {
    margin: 0.75rem 0 1.1rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 31, 52, 0.35);
    background: rgba(255, 31, 52, 0.08);
}

.plan-summary-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 31, 52, 0.95);
    font-weight: 600;
}

.plan-summary-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-white, #f5f5f5);
}

.plan-summary-value {
    margin: 0.35rem 0 0;
    font-size: 1rem;
    color: var(--text-muted, #aaa);
}

.subsection-title {
    margin: 1rem 0 0.65rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ddd;
}

.access-credentials {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid #363636;
    background: rgba(0, 0, 0, 0.28);
}

.access-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.85rem;
}

.access-row:last-child {
    margin-bottom: 0;
}

.access-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.access-value {
    font-size: 1.05rem;
    color: #f0f0f0;
    word-break: break-all;
}

.access-link {
    font-size: 1rem;
    color: rgba(255, 31, 52, 0.95);
    text-decoration: underline;
}

.access-mono {
    font-family: ui-monospace, monospace;
}

.integration-lead-times {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    color: var(--text-muted, #aaa);
    line-height: 1.55;
}

.integration-lead-times p {
    margin: 0.5rem 0 0;
}

@media (max-width: 860px) {
    .step-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid.two {
        grid-template-columns: 1fr;
    }

    .integration-cards-erp {
        grid-template-columns: 1fr;
    }
}
