/* First-run setup pages (_SetupLayout): dark step sidebar + light content area. */

.setup-body {
    margin: 0;
    background: #f7f9fc;
    color: #1b2440;
}

.setup-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---------------------------------------------------------- */

.setup-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #0f1f3d;
    color: #fff;
    padding: 28px 18px;
}

.setup-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 8px 36px;
}

.setup-brand-icon {
    width: 48px;
    height: 48px;
}

.setup-brand-name {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.setup-brand-account {
    color: #a9b6d3;
    font-size: 0.95rem;
}

.setup-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

/* The vertical line joining the step dots. */
.setup-steps::before {
    content: "";
    position: absolute;
    left: 27px;
    top: 30px;
    bottom: 30px;
    width: 2px;
    background: #2f6fdc;
}

.setup-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 12px;
    margin-bottom: 18px;
    border-radius: 12px;
    color: #7f8cab;
}

.setup-step.is-done {
    color: #fff;
}

a.setup-step {
    text-decoration: none;
}

a.setup-step:hover,
a.setup-step:focus-visible {
    background: #172e57;
    color: #fff;
}

.setup-step.is-active {
    background: #1e3a6e;
    color: #fff;
    box-shadow: inset 4px 0 0 #1a73e8;
}

.setup-step-dot {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border-radius: 50%;
    border: 2px solid #4d8cf5;
    background: #0f1f3d;
}

.setup-step.is-active .setup-step-dot {
    width: 26px;
    height: 26px;
    margin-left: 3px;
    border: 7px solid #1a73e8;
    background: #fff;
}

/* A finished step: filled dot. */
.setup-step.is-done:not(.is-active) .setup-step-dot {
    background: #4d8cf5;
}

.setup-step-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.setup-step-label {
    font-size: 1rem;
}

.setup-step-detail {
    display: block;
    color: #a9b6d3;
    font-size: 0.85rem;
}

/* ---- Main area -------------------------------------------------------- */

.setup-main {
    flex: 1;
    min-width: 0;
    background: #fff;
}

.setup-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    padding: 14px 28px;
    border-bottom: 1px solid #e3e8f0;
}

.setup-topbar-link {
    color: #1a56db;
    text-decoration: none;
}

.setup-flash {
    margin: 24px 44px 0;
}

.setup-user-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #eef3fb;
    color: #1b2440;
    padding: 9px;
}

.setup-user-button svg {
    width: 100%;
    height: 100%;
}

.setup-page-title {
    padding: 22px 44px;
    border-bottom: 1px solid #e3e8f0;
}

.setup-page-title h1 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 600;
}

.setup-welcome {
    background: #f7f9fc;
    min-height: calc(100vh - 170px);
    padding: 48px 24px;
    text-align: center;
}

.setup-hero {
    width: 340px;
    max-width: 100%;
    height: auto;
}

.setup-welcome h2 {
    margin-top: 28px;
    font-size: 2.4rem;
    font-weight: 700;
}

.setup-subtitle {
    color: #5a6680;
    font-size: 1.15rem;
    margin-bottom: 36px;
}

.setup-option-card {
    max-width: 450px;
    margin: 0 auto;
    padding: 28px 32px 34px;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
}

.setup-option-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 16px;
    padding: 20px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a56db;
}

.setup-option-icon svg {
    width: 100%;
    height: 100%;
}

.setup-option-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

.setup-option-card p {
    color: #5a6680;
    margin-bottom: 24px;
}

.setup-option-button {
    min-width: 220px;
    padding: 10px 24px;
    font-size: 1.1rem;
    background: #1a73e8;
    border-color: #1a73e8;
}

/* ---- Step pages --------------------------------------------------------- */

.setup-content {
    background: #f7f9fc;
    min-height: calc(100vh - 170px);
    padding: 32px 44px 48px;
}

.setup-panel {
    max-width: 900px;
    margin-bottom: 20px;
    padding: 24px 28px;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
}

.setup-panel-narrow {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.setup-panel-success {
    border-color: #b7e0c4;
}

.setup-panel-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.setup-subtitle-small {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 10px;
}

.setup-domain-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setup-domain-icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a56db;
}

.setup-domain-icon svg,
.setup-pencil svg {
    width: 100%;
    height: 100%;
    display: block;
}

.setup-domain-name {
    font-size: 1.2rem;
    word-break: break-all;
}

.setup-pencil {
    width: 34px;
    height: 34px;
    padding: 6px;
    color: #5a6680;
}

.setup-pencil:hover {
    color: #1a56db;
}

.setup-rename-form {
    margin-top: 16px;
    max-width: 520px;
}

/* "Add it for me" (Cloudflare) box above the manual records. */
.setup-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    margin-bottom: 8px;
    background: #f2f6fd;
    border: 1px solid #d4e1f9;
    border-radius: 10px;
}

.setup-choice h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.setup-records {
    font-size: 0.92rem;
}

.setup-records code {
    color: #1b2440;
}

.setup-record-value {
    min-width: 260px;
}

.setup-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    background: #eef1f6;
    color: #5a6680;
}

.setup-status.is-ok {
    background: #e3f5e9;
    color: #18794e;
}

.setup-status.is-pending {
    background: #fff4dc;
    color: #8a5a00;
}

.setup-mailbox-input {
    max-width: 460px;
}

.setup-actions {
    display: flex;
    gap: 12px;
    max-width: 900px;
    margin-top: 8px;
}

/* Existing records the Cloudflare preview would remove. */
.setup-conflicts {
    margin: 20px 0;
    padding: 16px 20px;
    background: #fdecec;
    border: 1px solid #f3b4b4;
    border-radius: 10px;
    color: #8f1c1c;
}

.setup-conflicts .setup-records {
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

.setup-done-icon {
    color: #18794e;
    background: #e3f5e9;
}

/* ---- Zoho-style step pages: centred hero, bottom action bar ------------- */

.setup-sidebar {
    display: flex;
    flex-direction: column;
}

.setup-admin-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 18px 12px 0;
    border-top: 1px solid #22355c;
    color: #fff;
    text-decoration: none;
}

.setup-admin-link svg {
    width: 24px;
    height: 24px;
    color: #f05a4f;
}

.setup-main {
    display: flex;
    flex-direction: column;
}

.setup-hero-page {
    flex: 1;
    padding: 48px 24px;
    text-align: center;
}

.setup-hero-page h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 20px 0 10px;
}

.setup-hero-page .setup-subtitle {
    max-width: 760px;
    margin: 0 auto 24px;
    font-size: 1rem;
}

.setup-hero-globe {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    padding: 28px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a56db;
}

.setup-hero-globe svg,
.setup-big-check svg {
    width: 100%;
    height: 100%;
}

.setup-big-check {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    padding: 18px;
    border-radius: 50%;
    background: #52c26e;
    color: #fff;
}

.setup-big-check svg circle {
    display: none;
}

.setup-big-check svg path {
    stroke-width: 2.6;
}

.setup-complete-title {
    font-size: 2rem !important;
}

.setup-hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.setup-manual {
    max-width: 960px;
    margin: 28px auto 0;
}

.setup-first-email {
    max-width: 520px;
    margin: 0 auto;
}

.setup-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    background: #f1f3f6;
    border-top: 1px solid #e3e8f0;
    position: sticky;
    bottom: 0;
}

.setup-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #7fcf9f;
    color: #0d3b22;
    font-weight: 600;
}

.setup-users-table th {
    background: #f1f3f6;
    font-weight: 500;
}

/* "DNS records for ..." dialog on the Domains list (Zoho-style). */
.dns-records-table thead th {
    background: #2f6fdc;
    color: #fff;
    text-align: center;
    font-weight: 500;
}

.dns-records-table .dns-records-label {
    background: #2f6fdc;
    color: #fff;
    text-align: center;
    width: 130px;
}

.dns-status-missing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1b2440;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Note box inside the delete-domain dialog (Zoho-style). */
.delete-note {
    padding: 16px 18px;
    background: #f6efe5;
    border-radius: 6px;
}

/* ---- Admin Console and signed-out pages (_Layout) ----------------------- */

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #c3cde3;
    text-decoration: none;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
    background: #172e57;
    color: #fff;
}

.app-nav-link.is-active {
    background: #1e3a6e;
    color: #fff;
    box-shadow: inset 4px 0 0 #1a73e8;
}

.app-content {
    min-height: calc(100vh - 71px);
    padding: 28px 44px 48px;
    background: #f7f9fc;
}

.app-content > h1:first-child,
.app-content > .alert + h1 {
    font-size: 1.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 48px 16px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 1.6rem;
    font-weight: 700;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 28px 32px;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 18px;
}


/* ---- Narrow screens: sidebar becomes a top block ----------------------- */

@media (max-width: 768px) {
    .setup-shell {
        flex-direction: column;
    }

    .setup-sidebar {
        width: 100%;
        padding: 18px 16px;
    }

    .setup-brand {
        padding-bottom: 18px;
    }

    .setup-step {
        padding: 10px 12px;
        margin-bottom: 6px;
    }

    .setup-steps::before {
        top: 20px;
        bottom: 20px;
    }

    .setup-page-title {
        padding: 16px;
    }

    .setup-content,
    .app-content {
        padding: 20px 16px 32px;
    }

    .auth-card {
        padding: 22px 18px;
    }

    .setup-panel {
        padding: 18px 16px;
    }

    .setup-flash {
        margin: 16px 16px 0;
    }

    .setup-choice {
        flex-direction: column;
        align-items: stretch;
    }

    .setup-welcome h2 {
        font-size: 1.8rem;
    }
}
