/*
 * vDisain Role Manager — frontend registration form styles
 *
 * All rules are scoped under .vdrm-registration-form so they can't leak into
 * the surrounding theme. CSS custom properties at the top let themes
 * override colors/spacing/radii without overriding individual rules.
 */
.vdrm-registration-form {
    --vdrm-form-radius: 8px;
    --vdrm-form-radius-lg: 12px;
    --vdrm-form-border: #d4d7df;
    --vdrm-form-border-strong: #b9bdc6;
    --vdrm-form-text: #1f2330;
    --vdrm-form-text-muted: #5c6370;
    --vdrm-form-primary: #2563eb;
    --vdrm-form-primary-dark: color-mix(in srgb, var(--vdrm-form-primary) 85%, #000);
    --vdrm-form-primary-soft: color-mix(in srgb, var(--vdrm-form-primary) 20%, #fff);
    --vdrm-form-on-primary: #ffffff;
    --vdrm-form-bg: #ffffff;
    --vdrm-form-surface: #f7f8fa;
    --vdrm-form-danger: #b42318;
    --vdrm-form-control-height: 42px;
    --vdrm-form-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);

    color: var(--vdrm-form-text);
    display: grid;
    gap: 24px;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    max-width: 920px;
}

.vdrm-registration-form *,
.vdrm-registration-form *::before,
.vdrm-registration-form *::after {
    box-sizing: border-box;
}

.vdrm-registration-form fieldset {
    border: 1px solid var(--vdrm-form-border);
    border-radius: var(--vdrm-form-radius-lg);
    padding: 20px 24px 22px;
    margin: 0;
    background: var(--vdrm-form-bg);
    box-shadow: var(--vdrm-form-shadow);
}

.vdrm-registration-form legend {
    padding: 0 8px;
    font-weight: 600;
    color: var(--vdrm-form-text);
    font-size: 14px;
}

.vdrm-registration-form .vdrm-section-description {
    color: var(--vdrm-form-text-muted);
    margin: 0 0 16px;
}

.vdrm-registration-intro {
    color: var(--vdrm-form-text-muted);
}

/* 12-column grid */
.vdrm-registration-form .vdrm-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.vdrm-registration-form .vdrm-row + .vdrm-row {
    margin-top: 16px;
}

.vdrm-registration-form .vdrm-col {
    grid-column: span 12;
    min-width: 0;
}
.vdrm-registration-form .vdrm-col-1 { grid-column: span 1; }
.vdrm-registration-form .vdrm-col-2 { grid-column: span 2; }
.vdrm-registration-form .vdrm-col-3 { grid-column: span 3; }
.vdrm-registration-form .vdrm-col-4 { grid-column: span 4; }
.vdrm-registration-form .vdrm-col-6 { grid-column: span 6; }
.vdrm-registration-form .vdrm-col-8 { grid-column: span 8; }
.vdrm-registration-form .vdrm-col-12 { grid-column: span 12; }

@media (max-width: 640px) {
    .vdrm-registration-form .vdrm-row {
        grid-template-columns: 1fr;
    }
    .vdrm-registration-form .vdrm-col,
    .vdrm-registration-form [class*="vdrm-col-"] {
        grid-column: 1 / -1;
    }
}

/* Field shell (label + control + description) */
.vdrm-registration-form .vdrm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.vdrm-registration-form .vdrm-field > span {
    font-weight: 500;
    color: var(--vdrm-form-text);
}

.vdrm-registration-form .vdrm-field small {
    color: var(--vdrm-form-text-muted);
    font-size: 12px;
}

/* Inputs */
.vdrm-registration-form .vdrm-field input[type="text"],
.vdrm-registration-form .vdrm-field input[type="email"],
.vdrm-registration-form .vdrm-field input[type="number"],
.vdrm-registration-form .vdrm-field input[type="url"],
.vdrm-registration-form .vdrm-field input[type="tel"],
.vdrm-registration-form .vdrm-field input[type="password"],
.vdrm-registration-form .vdrm-field input[type="date"],
.vdrm-registration-form .vdrm-field input[type="file"],
.vdrm-registration-form .vdrm-field textarea,
.vdrm-registration-form .vdrm-field select {
    width: 100%;
    height: var(--vdrm-form-control-height);
    padding: 8px 12px;
    border: 1px solid var(--vdrm-form-border-strong);
    border-radius: var(--vdrm-form-radius);
    background: var(--vdrm-form-bg);
    color: var(--vdrm-form-text);
    font-size: inherit;
    font-family: inherit;
    transition: border-color 150ms, box-shadow 150ms;
}

.vdrm-registration-form .vdrm-field textarea {
    height: auto;
    min-height: 96px;
    padding-top: 10px;
    resize: vertical;
}

.vdrm-registration-form .vdrm-field input[type="file"] {
    padding: 8px 12px;
    line-height: 1.4;
}

.vdrm-registration-form .vdrm-field input:focus,
.vdrm-registration-form .vdrm-field textarea:focus,
.vdrm-registration-form .vdrm-field select:focus {
    border-color: var(--vdrm-form-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    outline: none;
}

.vdrm-registration-form .vdrm-field input:disabled,
.vdrm-registration-form .vdrm-field textarea:disabled,
.vdrm-registration-form .vdrm-field select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Single checkbox */
.vdrm-registration-form .vdrm-field-checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.vdrm-registration-form .vdrm-field-checkbox input[type="checkbox"] {
    margin: 4px 0 0;
    width: 18px;
    height: 18px;
    accent-color: var(--vdrm-form-primary);
    flex-shrink: 0;
}

.vdrm-registration-form .vdrm-field-checkbox > span {
    font-weight: 500;
    line-height: 1.5;
}

.vdrm-registration-form .vdrm-field-checkbox small {
    flex-basis: 100%;
    margin-left: 28px;
}

/* Radio group */
.vdrm-registration-form fieldset.vdrm-field-radio {
    border: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
}

.vdrm-registration-form fieldset.vdrm-field-radio > legend {
    padding: 0;
    margin-bottom: 6px;
}

.vdrm-registration-form .vdrm-field-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 0;
}

.vdrm-registration-form .vdrm-field-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
    padding: 6px 0;
}

.vdrm-registration-form .vdrm-field-options input[type="radio"] {
    accent-color: var(--vdrm-form-primary);
}

/* HTML / static block */
.vdrm-registration-form .vdrm-field-html {
    color: var(--vdrm-form-text-muted);
}

/* Role selector */
.vdrm-registration-form .vdrm-role-selector {
    border: 1px solid var(--vdrm-form-border);
    border-radius: var(--vdrm-form-radius-lg);
    padding: 18px 22px 22px;
    background: var(--vdrm-form-bg);
}

.vdrm-registration-form .vdrm-role-selector > legend {
    padding: 0 8px;
}

.vdrm-registration-form .vdrm-role-selector select {
    width: 100%;
    height: var(--vdrm-form-control-height);
    border: 1px solid var(--vdrm-form-border-strong);
    border-radius: var(--vdrm-form-radius);
    padding: 8px 12px;
    background: var(--vdrm-form-bg);
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    transition: border-color 150ms, box-shadow 150ms;
}

.vdrm-registration-form .vdrm-role-selector select:focus {
    border-color: var(--vdrm-form-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    outline: none;
}

/* Card-style role selector */
.vdrm-registration-form .vdrm-role-cards {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.vdrm-registration-form .vdrm-role-cards .vdrm-role-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--vdrm-form-border-strong);
    border-radius: var(--vdrm-form-radius);
    background: var(--vdrm-form-surface);
    cursor: pointer;
    transition: border-color 150ms, box-shadow 150ms, background 150ms;
    position: relative;
}

.vdrm-registration-form .vdrm-role-cards .vdrm-role-option:hover {
    border-color: var(--vdrm-form-border-strong);
    background: var(--vdrm-form-bg);
}

.vdrm-registration-form .vdrm-role-cards .vdrm-role-option:has(input:checked) {
    border-color: var(--vdrm-form-primary);
    box-shadow: 0 0 0 3px var(--vdrm-form-primary-soft);
    background: var(--vdrm-form-bg);
}

.vdrm-registration-form .vdrm-role-cards .vdrm-role-option > span {
    font-weight: 600;
}

.vdrm-registration-form .vdrm-role-cards .vdrm-role-option > small {
    color: var(--vdrm-form-text-muted);
}

.vdrm-registration-form .vdrm-role-cards .vdrm-role-option input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Radio-style role selector */
.vdrm-registration-form .vdrm-role-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}

.vdrm-registration-form .vdrm-role-radios .vdrm-role-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.vdrm-registration-form .vdrm-role-radios .vdrm-role-option input[type="radio"] {
    accent-color: var(--vdrm-form-primary);
}

.vdrm-registration-form .vdrm-role-radios .vdrm-role-option > small {
    color: var(--vdrm-form-text-muted);
    margin-left: 6px;
}

/* Submit */
.vdrm-registration-form > button[type="submit"] {
    align-self: flex-start;
    padding: 11px 24px;
    font-weight: 600;
    font-size: 14px;
    color: var(--vdrm-form-on-primary);
    background: var(--vdrm-form-primary);
    border: 0;
    border-radius: var(--vdrm-form-radius);
    cursor: pointer;
    transition: background 150ms, transform 150ms;
}

.vdrm-registration-form > button[type="submit"]:hover {
    background: var(--vdrm-form-primary-dark);
}

.vdrm-registration-form > button[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.32);
}

.vdrm-registration-form > button[type="submit"]:active {
    transform: translateY(1px);
}

/*
 * Account status page (WC My Account → Account Status endpoint).
 * Same design tokens as the registration form, scoped under
 * .vdrm-account-status so it can't leak into the surrounding theme.
 */
.vdrm-account-status {
    --vdrm-as-radius: 12px;
    --vdrm-as-radius-sm: 8px;
    --vdrm-as-border: #e3e6ec;
    --vdrm-as-border-strong: #cfd3db;
    --vdrm-as-text: #1f2330;
    --vdrm-as-text-muted: #6a7080;
    --vdrm-as-bg: #ffffff;
    --vdrm-as-surface: #f7f8fa;
    --vdrm-as-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.04);

    --vdrm-as-pending-bg: #fff4d6;
    --vdrm-as-pending-fg: #8a5a00;
    --vdrm-as-approved-bg: #e3f7ea;
    --vdrm-as-approved-fg: #136d3a;
    --vdrm-as-rejected-bg: #fde4e1;
    --vdrm-as-rejected-fg: #9b1a13;
    --vdrm-as-neutral-bg: #eef0f4;
    --vdrm-as-neutral-fg: #4a4f5b;

    color: var(--vdrm-as-text);
    display: grid;
    gap: 24px;
    font-size: 14px;
    line-height: 1.55;
    box-sizing: border-box;
}

.vdrm-account-status *,
.vdrm-account-status *::before,
.vdrm-account-status *::after {
    box-sizing: border-box;
}

.vdrm-account-status__header {
    display: grid;
    gap: 6px;
}

.vdrm-account-status__header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--vdrm-as-text);
}

.vdrm-account-status__header p {
    margin: 0;
    color: var(--vdrm-as-text-muted);
    max-width: 60ch;
}

.vdrm-account-status__cards {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.vdrm-account-status__card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--vdrm-as-border);
    border-radius: var(--vdrm-as-radius);
    background: var(--vdrm-as-bg);
    box-shadow: var(--vdrm-as-shadow);
}

.vdrm-account-status__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vdrm-as-text-muted);
}

.vdrm-account-status__role {
    font-size: 16px;
    font-weight: 600;
    color: var(--vdrm-as-text);
}

.vdrm-account-status__badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: var(--vdrm-as-neutral-bg);
    color: var(--vdrm-as-neutral-fg);
    line-height: 1.2;
}

.vdrm-account-status__badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
    flex-shrink: 0;
}

.vdrm-account-status__badge--pending {
    background: var(--vdrm-as-pending-bg);
    color: var(--vdrm-as-pending-fg);
}

.vdrm-account-status__badge--approved {
    background: var(--vdrm-as-approved-bg);
    color: var(--vdrm-as-approved-fg);
}

.vdrm-account-status__badge--rejected {
    background: var(--vdrm-as-rejected-bg);
    color: var(--vdrm-as-rejected-fg);
}

.vdrm-account-status__section {
    display: grid;
    gap: 14px;
    padding: 22px 24px;
    border: 1px solid var(--vdrm-as-border);
    border-radius: var(--vdrm-as-radius);
    background: var(--vdrm-as-bg);
    box-shadow: var(--vdrm-as-shadow);
}

.vdrm-account-status__section h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--vdrm-as-text);
}

.vdrm-account-status__grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0;
    border-top: 1px solid var(--vdrm-as-border);
}

.vdrm-account-status__row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr);
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--vdrm-as-border);
    align-items: baseline;
}

.vdrm-account-status__row dt {
    margin: 0;
    color: var(--vdrm-as-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.vdrm-account-status__row dd {
    margin: 0;
    color: var(--vdrm-as-text);
    font-weight: 500;
    word-break: break-word;
}

@media (max-width: 640px) {
    .vdrm-account-status__row {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 12px 0;
    }
}
