/**
 * Workspace Setup screen — pre-cart configuration.
 *
 * Standalone front-end page (not the account portal), so this is self-contained.
 * Visual language mirrors the single-user onboarding wizard: centered white
 * rounded card, dark primary button.
 */

/* Hide the WordPress/Elementor page title ("Workspace Setup") on the setup page —
   the card carries its own heading. Scoped via :has() like the onboarding wizard. */
body:has(.ncwm-setup-wrapper) .page-header,
body:has(.ncwm-setup-wrapper) .entry-header,
body:has(.ncwm-setup-wrapper) header.entry-header,
body:has(.ncwm-setup-wrapper) h1.entry-title,
body:has(.ncwm-setup-wrapper) .entry-title,
body:has(.ncwm-setup-wrapper) .page-title,
body:has(.ncwm-setup-wrapper) .elementor-page-title {
    display: none;
}

.ncwm-setup-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: inherit;
}

.ncwm-setup-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ncwm-setup-card--message {
    text-align: center;
}

.ncwm-setup-heading {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    color: #000;
    margin: 0 0 10px 0;
}

.ncwm-setup-intro {
    color: #636363;
    margin: 0 0 30px 0;
}

/* ── Error summary ── */
.ncwm-setup-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 0 0 24px 0;
}

.ncwm-setup-error ul {
    margin: 0;
    padding-left: 18px;
}

/* ── Fields ── */
.ncwm-setup-field {
    margin-bottom: 22px;
}

.ncwm-setup-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1b1c1c;
    margin-bottom: 8px;
}

.ncwm-required {
    color: #c62828;
}

.ncwm-setup-field input[type="text"],
.ncwm-setup-field input[type="number"],
.ncwm-setup-field input[type="email"],
.ncwm-setup-field select {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid #a0a0a0;
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.ncwm-setup-field input:focus,
.ncwm-setup-field select:focus {
    border-color: #1b1c1c;
}

.ncwm-setup-hint {
    display: block;
    color: #999;
    font-size: 13px;
    margin-top: 6px;
}

/* ── Subdomain with suffix ── */
.ncwm-subdomain-wrapper {
    display: flex;
    align-items: stretch;
}

.ncwm-subdomain-wrapper input {
    border-radius: 10px 0 0 10px !important;
    border-right: 0 !important;
    flex: 1;
    min-width: 0;
}

.ncwm-domain-suffix {
    display: flex;
    align-items: center;
    background: #f4f4f6;
    border: 1px solid #a0a0a0;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    padding: 0 14px;
    color: #495057;
    white-space: nowrap;
}

/* ── Live subdomain availability feedback ── */
.ncwm-subdomain-feedback {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
    min-height: 18px;
}

.ncwm-subdomain-feedback:empty {
    display: none;
}

.ncwm-subdomain-feedback.is-checking {
    color: #999;
}

.ncwm-subdomain-feedback.is-available {
    color: #2e7d32;
}

.ncwm-subdomain-feedback.is-taken,
.ncwm-subdomain-feedback.is-invalid {
    color: #c62828;
}

/* ── Read-only quota ── */
.ncwm-setup-quota-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1b1c1c;
}

/* ── Actions / button ── */
.ncwm-setup-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

/* !important throughout to beat the parent theme's reset.css / Elementor button
   styles on this standalone page (mirrors the onboarding wizard's approach). */
.ncwm-setup-button,
a.ncwm-setup-button,
button.ncwm-setup-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #1b1c1c !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    transition: background 0.2s ease !important;
}

.ncwm-setup-button:hover,
.ncwm-setup-button:focus,
.ncwm-setup-button:active,
a.ncwm-setup-button:hover,
button.ncwm-setup-button:hover,
button.ncwm-setup-button:focus {
    background: #323333 !important;
    color: #fff !important;
}

button.ncwm-setup-button:disabled,
button.ncwm-setup-button[disabled] {
    background: #a0a0a0 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ncwm-setup-card {
        padding: 24px 20px;
    }

    .ncwm-setup-heading {
        font-size: 26px;
    }

    .ncwm-setup-actions {
        justify-content: stretch;
    }

    .ncwm-setup-button {
        width: 100%;
    }
}

/* Family manager: one group with email, username and name. */
.ncwm-setup-manager { border: 0; padding: 0; min-width: 0; }
.ncwm-setup-manager legend { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.ncwm-setup-manager > .ncwm-setup-hint:first-of-type { margin: 0 0 14px; }
.ncwm-setup-manager label { margin-top: 14px; }

.ncwm-storage-options { border: 0; padding: 0; min-width: 0; }
.ncwm-storage-options legend { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.ncwm-setup-field .ncwm-storage-option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #a0a0a0; border-radius: 10px; cursor: pointer; }
.ncwm-storage-option:has(input:checked) { background: #fafae6; border-color: #666340; }
.ncwm-storage-option input { flex: 0 0 auto; accent-color: #666340; }
.ncwm-storage-price { margin-left: auto; text-align: right; }
.ncwm-setup-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 16px 0; margin-bottom: 22px; border-bottom: 1px solid #ddd; }
