/* Generic VAPMA form layout + validation styles
 *
 * Goal:
 * - Keep the main application form nicely structured.
 * - Make small sidebar widgets (status / resend) compact.
 * - Let Divi control most outer spacing, fonts, colours.
 */

/* ------------------------------------------------------------------
 * 1. Shared wrappers – tiny padding for all forms
 * ------------------------------------------------------------------ */

.vapma-application-wrap,
.vapma-status-wrapper,
.vapma-resend-wrapper {
    padding: 3px;      /* thin “breathing room” around every form */
    margin: 0;         /* let Divi / theme control card spacing */
    box-sizing: border-box;
}

/* Main application layout (big form pages) */
.vapma-application-wrap {
    max-width: 760px;
    margin: 0 auto;    /* centre within its column without big top/bottom gaps */
}

/* ------------------------------------------------------------------
 * 2. Main application form – detailed layout
 * ------------------------------------------------------------------ */

/* Intro copy for main application */
.vapma-application-wrap .vapma-application-intro h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.vapma-application-wrap .vapma-application-intro p {
    margin-bottom: 1rem;
}

.vapma-application-wrap .vapma-application-intro-list {
    margin-bottom: 1rem;
}

/* Fieldsets for the main application form */
.vapma-application-wrap .vapma-fieldset {
    border: 1px solid #e2e2e2;
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
}

.vapma-application-wrap .vapma-fieldset legend {
    font-weight: 600;
    padding: 0 0.5rem;
}

/* Generic field wrapper – scoped so sidebars stay compact */
.vapma-application-wrap .vapma-field {
    margin-bottom: 1rem;
}

/* Labels – scoped so Divi can control sidebar fonts/spacing */
.vapma-application-wrap .vapma-field label,
.vapma-application-wrap .vapma-label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
}

/* Required asterisk – global (tiny, harmless) */
.vapma-required {
    color: #d63638;
    margin-left: 0.15rem;
}

/* Inputs / selects / textareas – scoped to the big form */
.vapma-application-wrap .vapma-field input[type="text"],
.vapma-application-wrap .vapma-field input[type="email"],
.vapma-application-wrap .vapma-field input[type="tel"],
.vapma-application-wrap .vapma-field input[type="date"],
.vapma-application-wrap .vapma-field select,
.vapma-application-wrap .vapma-field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Helper text – scoped so sidebar help text can be styled by Divi if desired */
.vapma-application-wrap .vapma-help {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.25rem;
}

/* Checkbox groups (used in main application) */
.vapma-application-wrap .vapma-checkbox-group label,
.vapma-application-wrap .vapma-fieldset-content label {
    font-weight: 400;
}

.vapma-application-wrap .vapma-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.vapma-application-wrap .vapma-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Other platforms repeater – main application only */
.vapma-application-wrap .vapma-other-platforms .vapma-other-platforms-row {
    margin-bottom: 0.5rem;
}

.vapma-application-wrap .vapma-other-platforms .vapma-other-platforms-row[data-initial-hidden="1"] {
    display: none;
}

.vapma-application-wrap .vapma-other-platforms .vapma-add-platform {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    background: #f7f7f7;
    cursor: pointer;
}

.vapma-application-wrap .vapma-other-platforms .vapma-add-platform[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Opt-in checkboxes – main application only */
.vapma-application-wrap .vapma-field.vapma-optin label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.vapma-application-wrap .vapma-field.vapma-optin input[type="checkbox"] {
    margin-top: 0.2rem;
}

/* Actions row – main application only */
.vapma-application-wrap .vapma-form-actions {
    margin-top: 1.5rem;
    text-align: right;
}

/* ------------------------------------------------------------------
 * 3. Shared behaviours / messages
 * ------------------------------------------------------------------ */

/* Disabled submit buttons – safe to apply to all forms */
.vapma-application-form .vapma-submit-button[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Flash messages – shared across all forms (big + sidebar) */
.vapma-app-error,
.vapma-application-form .vapma-app-error {
    border-left: 4px solid #d63638;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #fef2f2;
}

.vapma-app-success,
.vapma-application-form .vapma-app-success {
    border-left: 4px solid #00a32a;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #f0fff4;
}

/* Real-time validation highlighting – scoped to main application */
.vapma-application-wrap .vapma-field.vapma-has-error input[type="text"],
.vapma-application-wrap .vapma-field.vapma-has-error input[type="email"],
.vapma-application-wrap .vapma-field.vapma-has-error input[type="tel"],
.vapma-application-wrap .vapma-field.vapma-has-error input[type="date"],
.vapma-application-wrap .vapma-field.vapma-has-error select,
.vapma-application-wrap .vapma-field.vapma-has-error textarea {
    border-color: #d63638;
}

.vapma-inline-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #d63638;
}

/* ------------------------------------------------------------------
 * 4. Compact sidebar layout for status + resend widgets
 *    ([vapma_application_status], [vapma_resend_verification])
 * ------------------------------------------------------------------ */

/* Keep sidebar widgets compact – outer spacing comes from Divi module */
.vapma-status-wrapper,
.vapma-resend-wrapper {
    margin: 0 0 1.25rem;
}

/* Status widget: remove inner card framing so it matches resend form */
.vapma-status-wrapper .vapma-fieldset {
    border: 0;
    padding: 0;
    margin: 0.75rem 0 0;
    box-shadow: none;
    background: transparent;
}

/* Consistent button alignment (left) for the two small widgets */
.vapma-status-wrapper .vapma-form-actions,
.vapma-resend-wrapper .vapma-footer {
    text-align: left;
    margin-top: 0.75rem;
}

/* --------------------------------------------------------------
 * Part B – Finish Application / Verification UI
 * -------------------------------------------------------------- */

.vapma-verify-page {
    max-width: 720px;
    margin: 4rem auto;
    padding: 2.25rem 2.75rem;
    border-radius: 10px;
    background: #020617;
    color: #e5e7eb;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 15px 35px rgba(0,0,0,0.55);
}

.vapma-verify-page h1 {
    margin-top: 0;
    font-size: 1.7rem;
    margin-bottom: 0.75rem;
    color: #4ade80;
}

.vapma-verify-page h2 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
    color: #bfdbfe;
}

.vapma-verify-page p {
    line-height: 1.5;
    margin: 0.4rem 0;
}

.vapma-partb-page .vapma-partb-field-group {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.vapma-partb-page .vapma-partb-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vapma-partb-page .vapma-partb-field label {
    font-size: 0.93rem;
    font-weight: 500;
}

.vapma-partb-note {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.vapma-partb-samples-list {
    margin: 0.5rem 0 0.25rem;
    padding-left: 1.1rem;
    font-size: 0.93rem;
}

.vapma-partb-samples-list li {
    margin: 0.15rem 0;
}

.vapma-verify-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --------------------------------------------------------------
 * Part B – password reveal toggle
 * -------------------------------------------------------------- */

.vapma-partb-page .vapma-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.vapma-partb-page .vapma-password-wrapper input[type="password"],
.vapma-partb-page .vapma-password-wrapper input[type="text"] {
    width: 100%;
    padding-right: 3rem; /* room for the eye button */
}

.vapma-partb-page .vapma-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    box-shadow: none;          /* kill grey pill border */
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    appearance: none;          /* extra reset for some browsers */
}

.vapma-partb-page .vapma-password-toggle:focus {
}

.vapma-partb-page .vapma-password-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vapma-partb-page .vapma-password-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: #cf2e2e;
    stroke-width: 1.8;
    fill: none;
}

/* eye-open visible by default, eye-closed hidden */
.vapma-partb-page .vapma-password-icon-closed {
    display: none;
}

/* when password is visible, swap icons + emphasize stroke */
.vapma-partb-page .vapma-password-toggle.is-visible .vapma-password-icon-open {
    display: none;
}

.vapma-partb-page .vapma-password-toggle.is-visible .vapma-password-icon-closed {
    display: block;
}

.vapma-partb-page .vapma-password-toggle.is-visible .vapma-password-icon svg,
.vapma-partb-page .vapma-password-toggle.is-visible svg {
    stroke: #9ca3af;
}

/* ------------------------------------------------------------------
 * Verification / Part B page
 * ------------------------------------------------------------------ */

.vapma-verify-page {
    max-width: 640px;
    margin: 4rem auto;
    padding: 2rem 2.5rem;
    border-radius: 10px;
    background: #020617;
    color: #e5e7eb;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 15px 35px rgba(0,0,0,0.45);
}

.vapma-partb-page h1 {
    font-size: 1.7rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.vapma-partb-page h2 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.vapma-partb-page p,
.vapma-partb-page li {
    line-height: 1.5;
}

.vapma-partb-field-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.vapma-partb-field {
    flex: 1 1 200px;
}

.vapma-partb-samples-list {
    margin: 0.75rem 0 0.5rem;
    padding-left: 1.25rem;
}

.vapma-partb-note {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.75rem;
}

.vapma-partb-submit-wrap {
    margin-top: 1.75rem;
    text-align: right;
}

.vapma-partb-submit {
    background: #4ade80;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.6rem;
    font-weight: 600;
    cursor: pointer;
}

.vapma-partb-submit:hover {
    background: #22c55e;
}

/* --------------------------------------------------------------
 * Part B – file drop areas (sample images + video)
 * -------------------------------------------------------------- */

.vapma-partb-page .vapma-partb-field input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    padding: 1.1rem 1rem;
    border-radius: 8px;
    border: 2px dashed rgba(148, 163, 184, 0.75); /* slate-ish */
    background: rgba(15, 23, 42, 0.92);           /* deep navy */
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Tweak the built-in “Choose file” button so it blends in */
.vapma-partb-page .vapma-partb-field input[type="file"]::file-selector-button {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    margin-right: 0.75rem;
    background: #4ade80;
    color: #021212;
    font-weight: 600;
    cursor: pointer;
}

.vapma-partb-page .vapma-partb-field input[type="file"]:hover {
    border-color: #e5e7eb;
    background: rgba(15, 23, 42, 0.98);
}

.vapma-partb-page .vapma-partb-field input[type="file"]:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

/* ---------------------------------------------------------
 * Agreement full-text modal
 * ------------------------------------------------------ */

.vapma-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: none;          /* toggled via .is-visible */
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
}

.vapma-modal-overlay.is-visible {
    display: block;
}

.vapma-modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;

    max-width: 80vw;
    width: calc(100% - 1.5rem);
    max-height: 90vh;   /* was 80vh – a bit taller now */

    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vapma-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.vapma-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.vapma-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.vapma-modal-body {
    flex: 1 1 auto;
    background: #f8f8f8;
    overflow: hidden; /* iframe will handle scroll */
}

.vapma-modal-iframe {
    width: 100%;
    height: 85vh;        /* was 60vh – fills more vertically */
    max-height: 85vh;
    border: 0;
    display: block;
    background: #ffffff;
}

.vapma-modal-close {
    position: absolute;
    top: 0.4rem;
    right: 0.7rem;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #666666;
}

.vapma-modal-close:hover,
.vapma-modal-close:focus {
    color: #000000;
}

body.vapma-modal-open {
    overflow: hidden;
}
