/* A new website account (Components/Pages/Websites/NewWebsiteAccount.razor): first the plans, a centred head with the
   currency switch, the email's account count and the shared plan cards (WebbuilderUI css/plan-card.css); then the form,
   two cards of fields and the create bar in a readable column. The page frame is the shared app page one (WebbuilderUI
   css/app-page.css). Skeleton: Components/Skeletons/Websites/NewWebsiteAccountSkeleton.razor. */

/* ========
     head
   ======== */

/* The form step is one readable column, back link included */
.nwa-page-form {
    max-width: calc(880px + 2 * var(--ml-content-gutter, 32px));
}

.nwa-head {
    max-width: 880px;
    margin: 0 auto 24px;
}

.nwa-head-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 680px;
    text-align: center;
}

.nwa-head .apg-title {
    margin-top: 10px;
}

.nwa-currency {
    margin-top: 18px;
}

.nwa-currency .app-segmented-option {
    min-width: 64px;
}

/* The chosen plan and its price, under the form's title */
.nwa-plan-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 16px 0 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--app-accent-soft);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--app-accent);
}

.nwa-plan-chip .bx {
    flex: none;
    font-size: 16px;
}

.nwa-plan-chip-price {
    font-weight: 500;
    color: var(--app-text);
}

/* =========
     plans
   ========= */

/* How many website accounts the email has, above the plans */
.nwa-quota {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 24px;
    padding: 8px 16px;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    background: var(--app-surface);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--app-text-muted);
    text-align: center;
    overflow-wrap: anywhere;
    /* Two even lines on a phone rather than one word left alone on the second (browsers without it wrap as usual) */
    text-wrap: balance;
}

.nwa-quota .bx {
    flex: none;
    font-size: 18px;
    color: var(--app-accent);
}

/* The four plans in a row on a wide screen, as on the website builder's plans page (WebbuilderWeb css/Pages/Pricing.css);
   two per row while that would make the cards too narrow beside the sidebar, and one on a phone */
.nwa-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    max-width: 1320px;
    margin: 0 auto;
}

.nwa-col {
    display: flex;
    min-width: 0;
}

.nwa-col > .plancard {
    flex: 1 1 auto;
}

.nwa-note {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    max-width: 640px;
    margin: 28px auto 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text-muted);
    text-align: center;
}

.nwa-note .bx {
    flex: none;
    margin-top: 1px;
    font-size: 17px;
    color: var(--app-accent);
}

/* ========
     form
   ======== */

.nwa-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 880px;
    margin: 0 auto;
}

.nwa-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--app-line);
    border-radius: 24px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
}

.nwa-card-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nwa-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--app-text-strong);
}

.nwa-card-title .bx {
    flex: none;
    font-size: 20px;
    color: var(--app-accent);
}

.nwa-card-lead {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text-muted);
}

.nwa-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px 16px;
}

.nwa-wide {
    grid-column: 1 / -1;
}

/* "Optional" after a label */
.nwa-optional {
    margin-left: 6px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--app-text-muted);
}

/* The country menu as tall and wide as the text boxes beside it */
.nwa-select {
    width: 100%;
}

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

.nwa-select-invalid .app-sel-toggle {
    border-color: var(--app-danger);
    background: var(--app-danger-soft);
}

/* A label over a text box, spaced like .app-label above .app-input (skeleton) */
.nwa-skel-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.nwa-skel-quota {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

/* ---------- terms and create ---------- */

.nwa-submit {
    gap: 18px;
}

.nwa-terms {
    align-items: flex-start;
    line-height: 1.5;
}

.nwa-terms input {
    flex: none;
    margin-top: 2px;
}

.nwa-terms input[aria-invalid="true"] {
    border-color: var(--app-danger);
}

/* The terms message lines up with the sentence, past the box */
.nwa-terms + .app-hint {
    padding-left: 30px;
}

.nwa-terms-link {
    font-weight: 600;
    color: var(--app-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nwa-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--app-line);
}

.nwa-submit-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--app-text-muted);
    /* No single word left alone on the last line (browsers without it wrap as usual) */
    text-wrap: pretty;
}

.nwa-submit-note .bx {
    flex: none;
    margin-top: 1px;
    font-size: 16px;
    color: var(--app-accent);
}

.nwa-create {
    flex: none;
}

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

@media (max-width: 1399.98px) {
    .nwa-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 760px;
    }
}

@media (max-width: 767.98px) {
    .nwa-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 420px;
    }
}

/* Phone: one field per row; the create button takes the whole width under its note */
@media (max-width: 575.98px) {
    /* Two lines on a phone: a rounded box instead of a pill */
    .nwa-quota {
        border-radius: 16px;
    }

    .nwa-card {
        padding: 20px 18px;
    }

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

    .nwa-submit-row {
        flex-direction: column;
        align-items: stretch;
    }

    .nwa-create {
        width: 100%;
    }
}

/* Phone inputs at 16px, so iOS does not zoom in when one is focused */
@media (max-width: 767.98px) {
    .nwa-page .app-input {
        font-size: 16px;
    }
}
