/* Connecting a domain (Components/Pages/Domains/DomainConnect.razor): the three steps, the website and domain fields
   of the first step, the domain's DNS and the methods of the second, and the buttons under each step. Follows the website builder's connect flow (WebbuilderWeb
   css/Pages/Domains.css). The page frame and head are the shared app page ones (WebbuilderUI css/app-page.css). */

.dcn-page {
    max-width: calc(960px + 2 * var(--ml-content-gutter, 32px));
}

.dcn-box {
    padding: 24px;
    border: 1px solid var(--app-line);
    border-radius: 22px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
    animation: app-reveal-rise 0.45s var(--app-ease-out) backwards;
}

.dcn-box-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--app-text-strong);
}

/* ---------- connect steps ---------- */

.dcn-steps {
    display: flex;
    gap: 12px;
    margin: 20px 0 20px;
    padding: 12px;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    background: var(--app-surface);
    list-style: none;
}

.dcn-step {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* The line to the next step, filled once this step is done */
.dcn-step:not(:last-child)::after {
    content: "";
    flex: 1 1 auto;
    height: 2px;
    margin-right: 4px;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--app-accent) 50%, var(--app-line) 50%) right / 200% 100% no-repeat;
    transition: background-position 0.5s var(--app-ease-out);
}

.dcn-step-done:not(:last-child)::after {
    background-position: left;
}

.dcn-step-dot {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--app-line);
    border-radius: 50%;
    background: var(--app-surface);
    font-size: 13px;
    font-weight: 700;
    color: var(--app-text-muted);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.4s var(--app-ease-spring);
}

.dcn-step-dot .bx {
    font-size: 18px;
}

.dcn-step-current .dcn-step-dot {
    border-color: transparent;
    background: var(--app-gradient-brand);
    color: var(--app-color-white);
    transform: scale(1.08);
}

.dcn-step-done .dcn-step-dot {
    border-color: var(--app-accent);
    background: var(--app-accent-soft);
    color: var(--app-accent);
}

.dcn-step-name {
    flex: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--app-text-muted);
}

.dcn-step-current .dcn-step-name {
    color: var(--app-text-strong);
}

.dcn-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Each way to connect is a shared radio card (app-choice app-choice-radio): its icon, badge and tick on top, the
   title and the words under them */
.dcn-methods > .dcn-method {
    flex-direction: column;
    align-items: flex-start;
}

.dcn-method-top {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 6px;
}

.dcn-method-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--app-accent-soft);
    font-size: 22px;
    color: var(--app-accent);
}

.dcn-method-check {
    margin-left: auto;
    font-size: 22px;
    color: var(--app-accent);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s ease, transform 0.35s var(--app-ease-spring);
}

.dcn-method[aria-checked="true"] .dcn-method-check {
    opacity: 1;
    transform: scale(1);
}

.dcn-method-title {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--app-text-strong);
}

.dcn-method-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--app-text-muted);
}

.dcn-domain-input {
    position: relative;
}

.dcn-domain-input .bx {
    position: absolute;
    top: 50%;
    left: 16px;
    font-size: 20px;
    color: var(--app-text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.dcn-domain-input .app-input {
    height: 54px;
    padding-left: 46px;
    font-size: 16px;
}

.dcn-field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--app-danger);
    animation: app-reveal-rise 0.3s var(--app-ease-out) backwards;
}

.dcn-flow-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

/* The steps and the website field while the websites load */
.dcn-skel-steps {
    margin: 20px 0;
}

.dcn-skel-gap {
    margin: 9px 0 20px;
}

.dcn-skel-title {
    margin: 2px 0 18px;
}

.dcn-skel-input {
    margin-top: 9px;
}

/* What the entered domain's DNS looks like now (who runs it, whether it has email), above the methods */
.dcn-inspect {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: -4px 0 16px;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text);
}

.dcn-inspect li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dcn-inspect .bx {
    flex: none;
    font-size: 18px;
    line-height: 1;
    color: var(--app-accent);
}

/* The website menu as tall and wide as a text box */
.dcn-website {
    margin-bottom: 20px;
}

.dcn-website .app-sel {
    width: 100%;
}

.dcn-website .app-sel-toggle {
    width: 100%;
    height: 48px;
    border-radius: 12px;
}

/* The plan of the chosen website does not allow a domain: what to do about it */
.dcn-plan {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--app-warning-soft);
}

.dcn-plan-text {
    display: flex;
    flex: 1 1 260px;
    gap: 10px;
    min-width: 0;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text);
}

.dcn-plan-text .bx {
    flex: none;
    margin-top: 2px;
    font-size: 18px;
    color: var(--app-warning);
}

.dcn-plan-text strong {
    font-weight: 600;
    color: var(--app-text-strong);
}

.dcn-propagation {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--app-bg-soft);
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text);
}

.dcn-propagation .bx {
    flex: none;
    margin-top: 2px;
    font-size: 18px;
    color: var(--app-accent);
}

/* ==============
     responsive
   ============== */

@media (max-width: 767.98px) {
    .dcn-box {
        padding: 18px;
    }

    .dcn-methods {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Only the current step keeps its name on a phone */
    .dcn-step-name {
        display: none;
    }

    .dcn-step-current .dcn-step-name {
        display: inline;
    }

    .dcn-steps {
        gap: 8px;
        padding: 10px;
    }

    .dcn-flow-foot .app-btn {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dcn-box,
    .dcn-field-error {
        animation: none;
    }

    .dcn-step-dot,
    .dcn-step:not(:last-child)::after {
        transition: none;
    }
}
