/* ============================================================
   Fellowship Form — Refined Professional Design
   Brand: IAPD Fellowship Portal
   Aesthetic: Authoritative Navy × Champagne Gold × Surgical Precision
   
   Brand Tokens:
   - Deep Navy:    #0B1E3D
   - Royal Blue:   #1647A7
   - Sky:          #1FA2DE
   - Gold:         #C9A84C
   - Gold Light:   #E8C96A
   - Sage Green:   #3DA85B
   - Background:   #F5F7FC
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    /* Brand Palette */
    --f-navy:          #0B1E3D;
    --f-navy-mid:      #162D56;
    --f-royal:         #1647A7;
    --f-royal-light:   #2258C4;
    --f-sky:           #1FA2DE;
    --f-sky-light:     #4DBDE8;
    --f-gold:          #C9A84C;
    --f-gold-light:    #E8C96A;
    --f-gold-pale:     #FBF3DC;
    --f-green:         #3DA85B;
    --f-green-light:   #4FC46E;
    --f-green-pale:    #E8F5ED;
    --f-red:           #C0392B;
    --f-red-pale:      #FDECEA;
    --f-amber:         #D97706;
    --f-amber-pale:    #FEF3C7;

    /* Surfaces */
    --f-bg:            #F5F7FC;
    --f-surface:       #FFFFFF;
    --f-surface-2:     #F0F4FB;
    --f-border:        #D6DFEE;
    --f-border-light:  #E8EDF6;

    /* Typography */
    --f-text-dark:     #0B1E3D;
    --f-text-mid:      #3D5070;
    --f-text-soft:     #6B7EA0;
    --f-text-muted:    #9BAAC4;
    --f-font-display:  'Playfair Display', Georgia, serif;
    --f-font-body:     'DM Sans', system-ui, sans-serif;

    /* Elevation */
    --f-shadow-xs:     0 1px 3px rgba(11,30,61,.06);
    --f-shadow-sm:     0 2px 8px rgba(11,30,61,.08);
    --f-shadow-md:     0 6px 20px rgba(11,30,61,.10);
    --f-shadow-lg:     0 16px 40px rgba(11,30,61,.13);
    --f-shadow-xl:     0 28px 64px rgba(11,30,61,.16);
    --f-shadow-gold:   0 8px 24px rgba(201,168,76,.25);

    /* Shape */
    --f-r-xs:  4px;
    --f-r-sm:  8px;
    --f-r-md:  12px;
    --f-r-lg:  18px;
    --f-r-xl:  24px;
    --f-r-2xl: 32px;

    /* Motion */
    --f-ease:     cubic-bezier(0.4, 0, 0.2, 1);
    --f-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --f-t-fast:   0.15s;
    --f-t-base:   0.25s;
    --f-t-slow:   0.4s;

    /* Legacy aliases for compatibility */
    --llw-primary:       var(--f-royal);
    --llw-primary-dark:  #123d8a;
    --llw-secondary:     #2F55A6;
    --llw-accent:        var(--f-green);
    --llw-accent-dark:   #3aa342;
    --llw-light-blue:    var(--f-sky);
    --llw-bg-light:      var(--f-surface-2);
    --llw-gradient-start: var(--f-royal);
    --llw-gradient-end:   var(--f-sky);
    --llw-text-dark:     var(--f-text-dark);
    --llw-text-medium:   var(--f-text-mid);
    --llw-text-light:    var(--f-text-soft);
    --llw-border:        var(--f-border);
    --llw-border-light:  var(--f-border-light);
    --llw-white:         #ffffff;
    --llw-error:         var(--f-red);
    --llw-warning:       var(--f-amber);
    --llw-success:       var(--f-green);
    --llw-shadow-sm:     var(--f-shadow-xs);
    --llw-shadow-md:     var(--f-shadow-sm);
    --llw-shadow-lg:     var(--f-shadow-md);
    --llw-radius-sm:     var(--f-r-xs);
    --llw-radius-md:     var(--f-r-md);
    --llw-radius-lg:     var(--f-r-xl);
    --llw-transition:    all var(--f-t-base) var(--f-ease);
}

/* ============================================================
   Page Background
   ============================================================ */
.llw-fellowship-form-wrapper,
.llw-fellowship-form-wrapper * {
    box-sizing: border-box;
    font-family: var(--f-font-body);
}


/* ============================================================
   Main Wrapper — Entry Animation
   ============================================================ */
.llw-fellowship-form-wrapper {
    max-width: 920px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    animation: wrapperReveal 0.5s var(--f-ease-out) both;
}

@keyframes wrapperReveal {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Portal Header — Masthead
   ============================================================ */
.llw-fellowship-form-wrapper::before {
    content: 'IAPD Fellowship Portal';
    display: block;
    font-family: var(--f-font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--f-gold);
    padding: 0 0 18px 0;
    opacity: 0.8;
}

/* ============================================================
   Inner Card Shell
   ============================================================ */
.llw-fellowship-form-wrapper > form,
.llw-fellowship-form-wrapper .llw-fellowship-progress,
.llw-fellowship-form-wrapper .llw-fellowship-complete-wrapper {
    background: var(--f-surface);
    border-radius: var(--f-r-xl);
    box-shadow: var(--f-shadow-lg);
    overflow: hidden;
}

/* Form itself needs padding after removing outer wrapper padding */
.llw-fellowship-form-wrapper > form {
    padding: 40px 48px 48px;
    border-top: 3px solid transparent;
    background-image:
        linear-gradient(var(--f-surface), var(--f-surface)),
        linear-gradient(90deg, var(--f-royal), var(--f-sky));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* ============================================================
   Progress Tracker — Elevated Horizontal Rail
   ============================================================ */
.llw-fellowship-progress {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding: 28px 48px 0;
    position: relative;
    background: var(--f-surface) !important;
    border-radius: var(--f-r-xl) var(--f-r-xl) 0 0 !important;
    box-shadow: none !important;
}

/* connecting line */
.llw-fellowship-progress::before {
    content: '';
    position: absolute;
    top: 52px;
    left: 100px;
    right: 100px;
    height: 2px;
    background: var(--f-border);
    z-index: 0;
    border-radius: 2px;
}

/* progress fill overlay */
.llw-fellowship-progress::after {
    content: '';
    position: absolute;
    top: 52px;
    left: 100px;
    right: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--f-royal) 0%, var(--f-sky) 60%, var(--f-gold) 100%);
    z-index: 0;
    border-radius: 2px;
    transform-origin: left;
    transform: scaleX(0.01);
    transition: transform 0.6s var(--f-ease);
}

.llw-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    padding-bottom: 24px;
}

.llw-progress-step .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--f-surface);
    border: 2px solid var(--f-border);
    color: var(--f-text-muted);
    font-family: var(--f-font-body);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    transition: all var(--f-t-base) var(--f-ease);
    box-shadow: var(--f-shadow-xs);
    position: relative;
    z-index: 1;
}

.llw-progress-step .step-title {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--f-text-muted);
    text-transform: uppercase;
    transition: color var(--f-t-base) var(--f-ease);
}

/* Active Step */
.llw-progress-step.active .step-number {
    background: linear-gradient(140deg, var(--f-royal) 0%, var(--f-sky) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 18px rgba(22,71,167,.35), 0 0 0 5px rgba(22,71,167,.12);
    transform: scale(1.08);
}

.llw-progress-step.active .step-title {
    color: var(--f-royal);
    font-weight: 700;
}

/* Completed Step */
.llw-progress-step.completed .step-number {
    background: linear-gradient(140deg, var(--f-green) 0%, var(--f-green-light) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(61,168,91,.3);
}

.llw-progress-step.completed .step-number::after {
    content: '✓';
    font-size: 18px;
    font-weight: 800;
}

.llw-progress-step.completed .step-number span {
    display: none;
}

.llw-progress-step.completed .step-title {
    color: var(--f-green);
}

/* Divider between progress and form body */
.llw-fellowship-progress + form {
    border-radius: 0 0 var(--f-r-xl) var(--f-r-xl) !important;
    box-shadow: var(--f-shadow-lg) !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* ============================================================
   Step Headings
   ============================================================ */
.llw-fellowship-step h2,
.llw-section-heading {
    font-family: var(--f-font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--f-navy);
    margin: 0 0 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--f-border-light);
    position: relative;
    line-height: 1.3;
}

.llw-fellowship-step h2::after,
.llw-section-heading::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, var(--f-gold), var(--f-gold-light));
    border-radius: 2px;
}

.llw-fellowship-step > p {
    color: var(--f-text-soft);
    font-size: 14px;
    line-height: 1.7;
    margin: 12px 0 28px;
    max-width: 640px;
}

/* Sub-headings inside steps */
.llw-fellowship-step h2.llw-section-heading {
    font-family: var(--f-font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--f-text-dark);
    letter-spacing: 0;
    margin-top: 32px;
    padding-bottom: 10px;
}

/* ============================================================
   Form Grid & Fields
   ============================================================ */
.llw-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 24px;
    margin-bottom: 8px;
}

.llw-form-section {
    margin-bottom: 32px;
}

.llw-form-section:last-child {
    margin-bottom: 0;
}

/* Width classes */
.llw-field-width-25  { flex-basis: calc(25% - 18px);     min-width: 120px; }
.llw-field-width-33  { flex-basis: calc(33.333% - 16px); min-width: 150px; }
.llw-field-width-37  { flex-basis: calc(37.5% - 18px);   min-width: 180px; }
.llw-field-width-50  { flex-basis: calc(50% - 12px);     min-width: 200px; }
.llw-field-width-100 { flex-basis: 100%; }

/* ============================================================
   Form Field — Floating Label Pattern
   ============================================================ */
.llw-form-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Floating label */
.llw-form-field > label:first-child {
    position: absolute;
    left: 14px;
    top: 0;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--f-royal);
    background: linear-gradient(180deg, #fff 60%, transparent 100%);
    padding: 0 6px;
    z-index: 2;
    pointer-events: none;
    transition: all var(--f-t-base) var(--f-ease);
}

.llw-form-field.is-focused > label:first-child {
    color: var(--f-sky);
}

.llw-form-field.is-empty:not(.is-focused) > label:first-child {
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--f-text-muted);
    background: transparent;
}

.llw-form-field.is-empty:not(.is-focused) > label[for="dental_license_regions_input"]:first-child {
    top: 22%;
}
.llw-form-field.is-empty:not(.is-focused) > label[for="address_search"]:first-child {
    top: 30%;
}

label:has(~ [required])::after { content: " *"; color: var(--f-red); white-space: nowrap; }
[required] ~ label::after      { content: " *"; color: var(--f-red); white-space: nowrap; }

/* Always-floated label for select/date/file/textarea */
.llw-form-field:has(select) > label:first-child,
.llw-form-field:has(input[type="date"]) > label:first-child,
.llw-form-field:has(input[type="file"]) > label:first-child,
.llw-form-field:has(textarea) > label:first-child {
    top: 0 !important;
    transform: translateY(-50%) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: var(--f-royal) !important;
    background: #fff !important;
}

/* ============================================================
   Input, Select, Textarea
   ============================================================ */
.llw-form-field input[type="text"],
.llw-form-field input[type="email"],
.llw-form-field input[type="tel"],
.llw-form-field input[type="url"],
.llw-form-field input[type="date"],
.llw-form-field input[type="number"],
.llw-form-field select,
.llw-form-field textarea {
    width: 100%;
    padding: 15px 16px;
    border: 1.5px solid var(--f-border);
    border-radius: var(--f-r-md);
    font-size: 14.5px;
    font-family: var(--f-font-body);
    font-weight: 400;
    color: var(--f-text-dark);
    background: var(--f-surface);
    transition: border-color var(--f-t-fast) var(--f-ease),
                box-shadow   var(--f-t-fast) var(--f-ease),
                background   var(--f-t-fast) var(--f-ease);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.llw-form-field input:hover,
.llw-form-field select:hover,
.llw-form-field textarea:hover {
    border-color: var(--f-text-muted);
}

.llw-form-field input:focus,
.llw-form-field select:focus,
.llw-form-field textarea:focus {
    border-color: var(--f-royal);
    box-shadow: 0 0 0 4px rgba(22,71,167,.10);
    background: #FAFBFF;
}

.llw-form-field input::placeholder,
.llw-form-field textarea::placeholder {
    color: transparent;
}

/* Dropdown arrow */
.llw-form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231647A7' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 42px;
    cursor: pointer;
}

.llw-form-field textarea {
    min-height: 120px;
    resize: vertical;
    padding-top: 20px;
    line-height: 1.6;
}

/* ============================================================
   Checkbox Fields
   ============================================================ */
.llw-form-field:has(input[type="checkbox"]) {
    flex-direction: row;
    gap: 14px;
    align-items: flex-start;
}

.llw-form-field:has(input[type="checkbox"]) label {
    position: static;
    transform: none;
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--f-text-mid);
    line-height: 1.6;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.llw-form-field input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    border: 2px solid var(--f-border);
    border-radius: var(--f-r-xs);
    cursor: pointer;
    accent-color: var(--f-royal);
    flex-shrink: 0;
}

/* ============================================================
   File Input
   ============================================================ */
.llw-form-field input[type="file"] {
    padding: 14px 16px;
    border: 2px dashed var(--f-border);
    border-radius: var(--f-r-md);
    background: var(--f-bg);
    cursor: pointer;
    font-size: 13.5px;
    color: var(--f-text-soft);
    transition: border-color var(--f-t-fast) var(--f-ease),
                background   var(--f-t-fast) var(--f-ease);
}

.llw-form-field input[type="file"]:hover {
    border-color: var(--f-royal);
    background: var(--f-surface-2);
}

.llw-field-description {
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--f-text-muted);
    line-height: 1.5;
}

/* ============================================================
   Buttons
   ============================================================ */
.llw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border: none;
    border-radius: var(--f-r-md);
    font-family: var(--f-font-body);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform    var(--f-t-fast) var(--f-ease),
                box-shadow   var(--f-t-fast) var(--f-ease),
                background   var(--f-t-base) var(--f-ease),
                opacity      var(--f-t-fast) var(--f-ease);
    text-decoration: none;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.llw-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Ripple on click */
.llw-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.2);
    opacity: 0;
    border-radius: inherit;
    transition: opacity 0.3s;
}
.llw-btn:active::after { opacity: 1; }

/* Primary — Navy to Sky gradient */
.llw-btn-primary {
    background: linear-gradient(120deg, var(--f-navy-mid) 0%, var(--f-royal) 45%, var(--f-sky) 100%);
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(22,71,167,.28);
}

.llw-btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 28px rgba(22,71,167,.38);
    transform: translateY(-2px);
}

.llw-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(22,71,167,.22);
}

.llw-fellowship-form-wrapper [type=button],
.llw-fellowship-form-wrapper [type=submit],
.llw-fellowship-form-wrapper button {
    border: none;
}

/* Secondary */
.llw-btn-secondary {
    background: var(--f-surface);
    color: var(--f-royal) !important;
    border: 1.5px solid var(--f-border) !important;
    box-shadow: var(--f-shadow-xs);
}

.llw-btn-secondary:hover:not(:disabled) {
    background: var(--f-surface-2);
    border-color: var(--f-royal) !important;
    box-shadow: var(--f-shadow-sm);
    transform: translateY(-1px);
}

/* Add CE Credit — Gold accent */
#add-ce-credit-btn {
    background: linear-gradient(120deg, #9A6E1A 0%, var(--f-gold) 50%, var(--f-gold-light) 100%);
    color: var(--f-navy) !important;
    box-shadow: 0 4px 16px rgba(201,168,76,.3);
    font-weight: 700;
}

#add-ce-credit-btn:hover:not(:disabled) {
    box-shadow: 0 8px 24px rgba(201,168,76,.4);
    transform: translateY(-2px);
}

/* Small buttons */
.llw-btn-small {
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: var(--f-r-sm);
    letter-spacing: 0;
}

.llw-btn-edit {
    background: linear-gradient(120deg, var(--f-sky) 0%, #4AC7F0 100%);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(31,162,222,.25);
}

.llw-btn-edit:hover {
    box-shadow: 0 4px 14px rgba(31,162,222,.35);
    transform: translateY(-1px);
}

.llw-btn-delete {
    background: linear-gradient(120deg, var(--f-red) 0%, #E74C5C 100%);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(192,57,43,.25);
}

.llw-btn-delete:hover {
    box-shadow: 0 4px 14px rgba(192,57,43,.35);
    transform: translateY(-1px);
}

/* ============================================================
   Form Actions Row
   ============================================================ */
.llw-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--f-border-light);
}

.llw-form-actions:has(.llw-btn:only-child) {
    justify-content: flex-end;
}

/* ============================================================
   CE Credits — Summary Banner
   ============================================================ */
.llw-ce-credits-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(120deg, var(--f-navy) 0%, var(--f-navy-mid) 60%, var(--f-royal) 100%);
    color: #fff;
    padding: 18px 24px;
    border-radius: var(--f-r-lg);
    margin-bottom: 20px;
    box-shadow: var(--f-shadow-md);
    position: relative;
    overflow: hidden;
}

.llw-ce-credits-summary::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(201,168,76,.25) 0%, transparent 70%);
    pointer-events: none;
}

.llw-ce-credits-summary strong {
    font-family: var(--f-font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--f-gold-light);
}

.llw-ce-credits-summary .credit-breakdown {
    font-size: 13px;
    color: rgba(255,255,255,.7);
    margin-left: 14px;
}

/* Progress ring inside summary (optional enhancement) */
.llw-ce-credits-summary .credits-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* ============================================================
   CE Credits Table
   ============================================================ */
.llw-ce-credits-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    border-radius: var(--f-r-lg);
    overflow: hidden;
    box-shadow: var(--f-shadow-sm);
    border: 1px solid var(--f-border-light);
}

.llw-ce-credits-table th {
    padding: 13px 16px;
    text-align: left;
    background: linear-gradient(120deg, var(--f-navy) 0%, var(--f-navy-mid) 100%);
    color: rgba(255,255,255,.85);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.llw-ce-credits-table th:first-child { border-radius: 0; }
.llw-ce-credits-table th:last-child  { border-radius: 0; }

.llw-ce-credits-table td {
    padding: 13px 16px;
    text-align: left;
    font-size: 13.5px;
    color: var(--f-text-mid);
    background: var(--f-surface);
    border-bottom: 1px solid var(--f-border-light);
}

.llw-ce-credits-table tbody tr {
    transition: background var(--f-t-fast) var(--f-ease);
}

.llw-ce-credits-table tbody tr:hover td {
    background: var(--f-surface-2);
}

.llw-ce-credits-table tbody tr:last-child td {
    border-bottom: none;
}

.llw-ce-credits-table .no-credits td {
    text-align: center;
    color: var(--f-text-muted);
    font-style: italic;
    padding: 48px 16px;
    background: var(--f-bg);
    font-size: 14px;
}

/* ============================================================
   Status Badges
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    line-height: 1;
}

.status-pending  { background: var(--f-amber-pale);  color: var(--f-amber); }
.status-approved { background: var(--f-green-pale);  color: var(--f-green); }
.status-rejected { background: var(--f-red-pale);    color: var(--f-red);   }
.status-paid     { background: var(--f-green-pale);  color: var(--f-green); }

/* ============================================================
   Modal
   ============================================================ */
.llw-modal {
    position: fixed;
    inset: 0;
    background: rgba(11,30,61,.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.llw-modal-content {
    background: var(--f-surface);
    border-radius: var(--f-r-xl);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: var(--f-shadow-xl);
    animation: modalSlideIn 0.3s var(--f-ease-out) both;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

.llw-modal-content > h2 {
    background: linear-gradient(120deg, var(--f-navy) 0%, var(--f-royal) 60%, var(--f-sky) 100%);
    color: #fff;
    margin: 0;
    padding: 22px 32px;
    font-family: var(--f-font-display);
    font-size: 19px;
    font-weight: 700;
    position: relative;
}

/* Gold accent bar on modal header */
.llw-modal-content > h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--f-gold), transparent 60%);
}

.llw-modal-content > form {
    padding: 24px 32px 32px;
    max-height: calc(90vh - 75px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--f-border) transparent;
}

.llw-modal-content > form::-webkit-scrollbar { width: 5px; }
.llw-modal-content > form::-webkit-scrollbar-thumb { background: var(--f-border); border-radius: 3px; }

.llw-modal-close {
    position: absolute;
    top: 18px;
    right: 24px;
    font-size: 28px;
    font-weight: 300;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    line-height: 1;
    transition: color var(--f-t-fast), transform var(--f-t-fast);
    z-index: 1;
}

.llw-modal-close:hover {
    color: #fff;
    transform: scale(1.15) rotate(90deg);
}

.llw-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--f-border-light);
}

.llw-modal-cancel {
    background: var(--f-bg) !important;
    color: var(--f-text-mid) !important;
    border: 1.5px solid var(--f-border) !important;
}

/* ============================================================
   Review Section (Step 4)
   ============================================================ */
.llw-review-section {
    background: var(--f-bg);
    padding: 22px 24px;
    border-radius: var(--f-r-lg);
    margin-bottom: 16px;
    border: 1px solid var(--f-border-light);
    position: relative;
    overflow: hidden;
}

.llw-review-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--f-royal), var(--f-sky));
}

.llw-review-section h3 {
    margin: 0 0 12px;
    color: var(--f-navy);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--f-border-light);
}

.llw-fee-amount {
    font-family: var(--f-font-display);
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(120deg, var(--f-gold) 0%, var(--f-gold-light) 60%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0 4px;
    line-height: 1.1;
    display: block;
}

.llw-fee-description {
    color: var(--f-text-soft);
    font-size: 13.5px;
    margin: 0;
}

/* ============================================================
   Completion Wrapper
   ============================================================ */
.llw-fellowship-complete-wrapper {
    margin-bottom: 28px;
    border-radius: var(--f-r-xl);
    overflow: hidden;
    box-shadow: var(--f-shadow-lg);
}

.llw-complete-header {
    background: linear-gradient(135deg, var(--f-navy) 0%, var(--f-royal) 50%, var(--f-sky) 100%);
    color: #fff;
    padding: 52px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Decorative circles */
.llw-complete-header::before,
.llw-complete-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.llw-complete-header::before {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(201,168,76,.15) 0%, transparent 70%);
    top: -60px; right: -40px;
}
.llw-complete-header::after {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
    bottom: -50px; left: -30px;
}

.llw-complete-icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,.15);
    border: 3px solid rgba(255,255,255,.5);
    border-radius: 50%;
    font-size: 40px;
    line-height: 80px;
    text-align: center;
    margin: 0 auto 20px;
    display: block;
    animation: completePop 0.6s var(--f-ease-out) 0.2s both;
}

@keyframes completePop {
    from { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.1); }
    to   { transform: scale(1);   opacity: 1; }
}

.llw-complete-header h2 {
    font-family: var(--f-font-display);
    margin: 0 0 12px;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    border: none;
    padding: 0;
}

.llw-complete-header h2::after { display: none; }

.llw-complete-subtitle {
    margin: 0;
    font-size: 16px;
    color: rgba(255,255,255,.85);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

.llw-complete-message {
    background: var(--f-surface);
    padding: 32px 40px;
    border: 1px solid var(--f-border-light);
    border-top: none;
}

.llw-task-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.llw-task-checklist li {
    padding: 14px 20px;
    border-radius: var(--f-r-md);
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--f-t-fast) var(--f-ease);
    animation: checklistReveal 0.4s var(--f-ease-out) both;
}

.llw-task-checklist li:nth-child(1) { animation-delay: 0.1s; }
.llw-task-checklist li:nth-child(2) { animation-delay: 0.2s; }
.llw-task-checklist li:nth-child(3) { animation-delay: 0.3s; }
.llw-task-checklist li:nth-child(4) { animation-delay: 0.4s; }

@keyframes checklistReveal {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0);     }
}

.llw-task-checklist li.completed {
    background: var(--f-green-pale);
    color: #1E6E35;
    border-left: 3px solid var(--f-green);
}

.llw-task-checklist li.incomplete {
    background: var(--f-amber-pale);
    color: #92400E;
    border-left: 3px solid var(--f-amber);
}

.llw-next-steps {
    background: linear-gradient(120deg, var(--f-gold-pale) 0%, rgba(201,168,76,.08) 100%);
    padding: 16px 22px;
    border-radius: var(--f-r-md);
    border-left: 3px solid var(--f-gold);
    color: #6B4A0E !important;
    font-weight: 600;
    margin: 20px 0 0;
    font-size: 14px;
    line-height: 1.6;
}

.llw-complete-actions {
    background: var(--f-bg);
    padding: 28px 40px;
    border: 1px solid var(--f-border-light);
    border-top: none;
    border-radius: 0 0 var(--f-r-xl) var(--f-r-xl);
    text-align: center;
}

/* ============================================================
   Form Messages
   ============================================================ */
.llw-form-message {
    margin-top: 20px;
    padding: 16px 22px;
    border-radius: var(--f-r-md);
    display: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    animation: messageSlide 0.3s var(--f-ease-out);
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.llw-form-message.success,
.llw-success {
    background: var(--f-green-pale);
    color: #155724;
    border-left: 3px solid var(--f-green);
}

.llw-form-message.error,
.llw-error {
    background: var(--f-red-pale);
    color: #7B1818;
    border-left: 3px solid var(--f-red);
    padding: 16px 22px;
    border-radius: var(--f-r-md);
}

.llw-info {
    background: var(--f-surface-2);
    color: var(--f-royal);
    border-left: 3px solid var(--f-royal);
    padding: 16px 22px;
    border-radius: var(--f-r-md);
    font-size: 14px;
    line-height: 1.6;
}

.llw-info h3 {
    font-family: var(--f-font-display);
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--f-navy);
}

/* ============================================================
   Mapbox / Address Search
   ============================================================ */
.llw-mapbox-location-wrapper,
.llw-address-search-wrapper {
    position: relative;
    width: 100%;
}

.llw-mapbox-location-wrapper input[type="text"],
.llw-address-search-input {
    width: 100%;
    padding: 15px 16px;
    border: 1.5px solid var(--f-border);
    border-radius: var(--f-r-md);
    font-family: var(--f-font-body);
    font-size: 14.5px;
    color: var(--f-text-dark);
    outline: none;
    transition: border-color var(--f-t-fast) var(--f-ease),
                box-shadow   var(--f-t-fast) var(--f-ease);
}

.llw-mapbox-location-wrapper input:focus,
.llw-address-search-input:focus {
    border-color: var(--f-royal);
    box-shadow: 0 0 0 4px rgba(22,71,167,.10);
}

.llw-mapbox-suggestions,
.llw-address-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--f-surface);
    border: 1.5px solid var(--f-border);
    border-radius: var(--f-r-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--f-shadow-lg);
    animation: dropdownOpen 0.15s var(--f-ease-out);
}

@keyframes dropdownOpen {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.llw-mapbox-suggestion-item,
.llw-address-suggestion-item {
    padding: 13px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--f-border-light);
    transition: background var(--f-t-fast);
    font-size: 13.5px;
    color: var(--f-text-mid);
}

.llw-mapbox-suggestion-item:hover,
.llw-address-suggestion-item:hover,
.llw-address-suggestion-item.highlighted {
    background: var(--f-surface-2);
    color: var(--f-navy);
}

.llw-mapbox-suggestion-item:last-child,
.llw-address-suggestion-item:last-child {
    border-bottom: none;
}

/* Address Display */
.llw-address-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border: 1.5px solid var(--f-green);
    border-radius: var(--f-r-md);
    background: var(--f-green-pale);
    font-size: 14px;
    color: var(--f-text-dark);
}

.llw-change-address-btn {
    font-size: 12px;
    font-weight: 700;
    color: var(--f-royal);
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    padding: 0 !important;
    flex-shrink: 0;
}

.llw-address-search-wrapper.error .llw-address-search-input {
    border-color: var(--f-red);
    box-shadow: 0 0 0 4px rgba(192,57,43,.08);
}

/* Location Tags */
.llw-location-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 20px;
}

.llw-location-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(120deg, var(--f-navy-mid) 0%, var(--f-royal) 100%);
    color: #fff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    animation: tagFadeIn 0.25s var(--f-ease-out);
    box-shadow: 0 2px 8px rgba(22,71,167,.2);
}

@keyframes tagFadeIn {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1);    }
}

.llw-remove-tag {
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    transition: background var(--f-t-fast);
    color: white;
    border: none;
    padding: 0 !important;
}

.llw-remove-tag:hover {
    background: rgba(192,57,43,.8);
}

#llw-fellowship-form .llw-remove-tag {
    color: white;
    background: rgba(220, 53, 69, 0.6);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 99px;
    padding: 0 4px;
}
#llw-fellowship-form .llw-remove-tag:hover {
    background: rgba(192, 57, 43, 1);
}

/* ============================================================
   Conditional Fields
   ============================================================ */
.conditional-field { display: none; }
.location-fields   { display: none; width: 100%; flex-wrap: wrap; gap: 24px; }
.location-fields.visible { display: flex; }

/* ============================================================
   Attestation Checkboxes — Enhanced
   ============================================================ */
.llw-fellowship-step label:has(>[type="checkbox"]) {
    display: inline-flex;
    gap: 14px;
}

/* Attestation items get a card-like treatment */
.llw-fellowship-step[data-step="3"] .llw-form-field:has(input[type="checkbox"]) {
    background: var(--f-bg);
    padding: 14px 18px;
    border-radius: var(--f-r-md);
    border: 1px solid var(--f-border-light);
    transition: border-color var(--f-t-fast), background var(--f-t-fast);
    flex-basis: 100%;
}

.llw-fellowship-step[data-step="3"] .llw-form-field:has(input[type="checkbox"]:checked) {
    background: var(--f-green-pale);
    border-color: var(--f-green);
}

/* ============================================================
   Utility Helpers
   ============================================================ */
.hide { display: none !important; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .llw-fellowship-form-wrapper > form {
        padding: 28px 24px 36px;
    }

    .llw-fellowship-progress {
        padding: 20px 24px 0;
        overflow-x: auto;
    }

    .llw-fellowship-progress::before,
    .llw-fellowship-progress::after {
        left: 60px; right: 60px;
    }

    .llw-progress-step .step-title { font-size: 10px; }

    .llw-field-width-25,
    .llw-field-width-33,
    .llw-field-width-37 { flex-basis: calc(50% - 10px); }

    .llw-field-width-50 { flex-basis: 100%; }

    .llw-fellowship-step h2 { font-size: 19px; }
    .llw-fee-amount { font-size: 34px; }
}

@media (max-width: 480px) {
    .llw-fellowship-form-wrapper > form {
        padding: 20px 16px 28px;
    }

    .llw-field-width-25,
    .llw-field-width-33,
    .llw-field-width-37,
    .llw-field-width-50 { flex-basis: 100%; }

    .llw-form-actions { flex-direction: column-reverse; }
    .llw-form-actions .llw-btn { width: 100%; }

    .llw-progress-step .step-title { display: none; }
    .llw-ce-credits-summary { flex-direction: column; align-items: flex-start; gap: 8px; }
}
/* ============================================================
   Suite additions
   ------------------------------------------------------------
   Everything above is the legacy fellowship-form stylesheet,
   copied verbatim from llw-membership-fellowship so the restored
   wizard renders exactly as it did before the takeover.

   The rules below cover the three places the suite's markup
   differs from legacy's:

     1. Legacy switched steps client-side and its progress steps
        were inert <div>s. The suite navigates server-side, so a
        reachable step is a real <a> and needs the link styling
        neutralised; a locked one is a <span>.
     2. Legacy toggled the modal with inline style="display:none".
        The suite uses the `hidden` attribute, which `.llw-modal`'s
        display:flex would otherwise win against.
     3. Legacy's modal close was a <span>; it is a <button> here so
        it is reachable from the keyboard, which needs a reset.
   ============================================================ */

a.llw-progress-step,
span.llw-progress-step {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.llw-progress-step {
    cursor: pointer;
}

/* A step they have not unlocked yet reads as unavailable. */
span.llw-progress-step:not(.active):not(.completed) {
    opacity: .65;
    cursor: default;
}

a.llw-progress-step:hover .step-title {
    color: var(--f-royal);
}

a.llw-progress-step:focus-visible {
    outline: 2px solid var(--f-royal);
    outline-offset: 4px;
    border-radius: var(--f-r-md, 8px);
}

/* `hidden` must beat .llw-modal { display: flex }. */
.llw-modal[hidden] {
    display: none;
}

button.llw-modal-close {
    background: none;
    border: 0;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    font-size: 26px;
}

/* Back / Save and Continue are an <a> and a <button>; keep them level. */
.llw-form-actions .llw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.llw-ce-add-actions {
    margin: 18px 0 0;
}

.llw-ce-add-actions .llw-btn {
    width: 100%;
}

/* The wizard heading, above the progress bar. */
.llw-fellowship-heading {
    font-family: var(--f-font-display);
    color: var(--f-royal);
    text-align: center;
    margin: 0 0 4px;
}

.llw-step-intro {
    text-align: center;
    color: var(--f-text-mid);
    margin: 0 0 18px;
}

/* ============================================================
   Wizard field layout and polish
   ------------------------------------------------------------
   Added when the wizard was compared against the legacy screens.
   The rules above this block came across from the legacy plugin
   with the rest of the stylesheet; these are the ones that were
   never written because the markup they need did not exist yet.
   ============================================================ */

/* Field widths come from the legacy grid — .llw-form-grid with
   .llw-field-width-25/33/37/50/100 — which came across with the stylesheet and
   had nothing emitting it. Per-field widths beat uniform halves: city, state
   and postcode want 50/25/25, not three equal columns. Only the bits the
   legacy rules did not cover are added here. */
.llw-fellowship-step .llw-form-grid > p {
    margin: 0 0 4px;
    min-width: 0;
}
.llw-fellowship-step .llw-form-grid input[type="text"],
.llw-fellowship-step .llw-form-grid input[type="email"],
.llw-fellowship-step .llw-form-grid input[type="tel"],
.llw-fellowship-step .llw-form-grid input[type="url"],
.llw-fellowship-step .llw-form-grid input[type="date"],
.llw-fellowship-step .llw-form-grid select {
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 600px) {
    /* Below this the paired widths stop helping and start cramping. */
    .llw-fellowship-step .llw-form-grid > p[class*="llw-field-width"] {
        flex-basis: 100%;
    }
}

/* Fieldsets rendered with the browser's default hairline border and a
   legend sitting in it, which read as an unstyled form. */
.llw-fellowship-step fieldset.llw-qual-section,
.llw-fellowship-step fieldset {
    border: 1px solid var(--llw-border, #e2e6ec);
    border-radius: var(--llw-radius-md, 8px);
    padding: 20px 24px 8px;
    margin: 0 0 24px;
    background: #fff;
}
.llw-fellowship-step fieldset > legend {
    padding: 0 10px;
    font-weight: 600;
    color: var(--llw-navy, #12305c);
}

/* Conditional blocks are hidden by the `hidden` attribute the script sets;
   this keeps them hidden even where a theme resets [hidden]. */
.llw-fellowship-step .llw-conditional[hidden],
.llw-fellowship-step fieldset[hidden],
.llw-fellowship-step .llw-is-hidden {
    display: none !important;
}

/* "View evidence" had no rule of its own and inherited the theme's link
   colour, which on this theme is white — invisible against the row. */
.llw-fellowship-step .llw-ce-doc-link {
    display: inline-block;
    margin-bottom: 6px;
    padding: 4px 10px;
    border: 1px solid var(--llw-navy, #12305c);
    border-radius: var(--llw-radius-sm, 4px);
    background: #fff;
    color: var(--llw-navy, #12305c) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.llw-fellowship-step .llw-ce-doc-link:hover,
.llw-fellowship-step .llw-ce-doc-link:focus {
    background: var(--llw-navy, #12305c);
    color: #fff !important;
}

/* ADD NEW sat narrower than the table it belongs to and floated oddly. */
.llw-fellowship-step .llw-ce-add-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin: 16px 0 0;
}

/* The attestation notes box was barely wider than a single word. */
.llw-fellowship-step textarea[name="notes"],
.llw-fellowship-step textarea.llw-notes-field {
    width: 100%;
    min-height: 120px;
    box-sizing: border-box;
}

/* Declaration rows: keep the text in a block beside the box rather than
   letting it wrap back underneath it. */
.llw-fellowship-step .llw-declaration {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
}
.llw-fellowship-step .llw-declaration input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 3px;
}

/* Licence-region badges sit under their input. */
.llw-fellowship-step .llw-location-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* The gradient slid horizontally on hover in the legacy build
   (llw-membership-fellowship/assets/css/fellowship-admin.css:202-221). The
   colours here are the wizard's blues rather than the admin screen's greens. */
.llw-fellowship-step .llw-btn-primary,
.llw-fellowship-step button[type="submit"].llw-btn {
    background-image: linear-gradient(90deg, #12305c 0%, #2f6fb5 50%, #12305c 100%);
    background-size: 200% 100%;
    background-position: left center;
    transition: background-position .45s ease, box-shadow .3s ease, transform .3s ease;
}
.llw-fellowship-step .llw-btn-primary:hover,
.llw-fellowship-step button[type="submit"].llw-btn:hover {
    background-position: right center;
    box-shadow: 0 6px 20px rgba(18, 48, 92, .35);
    transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
    .llw-fellowship-step .llw-btn-primary,
    .llw-fellowship-step button[type="submit"].llw-btn {
        transition: none;
    }
}

/* The "On file" link had no rule of its own and inherited the theme's link
   colour — white here, so the document read as missing when it was present
   and reachable all along. Same defect as .llw-ce-doc-link. */
.llw-fellowship-step .llw-qual-doc__existing {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    font-size: 13px;
}
.llw-fellowship-step .llw-qual-doc__link {
    display: inline-block;
    padding: 3px 9px;
    border: 1px solid var(--llw-navy, #12305c);
    border-radius: var(--llw-radius-sm, 4px);
    background: #fff;
    color: var(--llw-navy, #12305c) !important;
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
}
.llw-fellowship-step .llw-qual-doc__link:hover,
.llw-fellowship-step .llw-qual-doc__link:focus {
    background: var(--llw-navy, #12305c);
    color: #fff !important;
}
/* The provenance note is an aside, not part of the link. */
.llw-fellowship-step .llw-qual-doc__existing em {
    color: var(--llw-muted, #6b7684);
    font-size: 12px;
}

/* ============================================================
   Typography — plugin-wide
   ------------------------------------------------------------
   The surrounding site uses Tahoma; the wizard was inheriting
   whatever the theme handed it, which read smaller and in a
   different face from the page around it.
   ============================================================ */
.llw-fellowship-form-wrapper,
.llw-fellowship-step,
.llw-modal,
.llw-modal-content,
.llw-fellowship-form-wrapper input,
.llw-fellowship-form-wrapper select,
.llw-fellowship-form-wrapper textarea,
.llw-modal input,
.llw-modal select,
.llw-modal textarea {
    font-family: Tahoma, Verdana, Geneva, sans-serif;
}

/* 16px floor from tablet up. Left alone on phones, where the theme's
   own scale is doing sensible things and 16px would crowd. */
@media (min-width: 768px) {
    .llw-fellowship-form-wrapper,
    .llw-fellowship-step,
    .llw-modal-content,
    .llw-fellowship-step label,
    .llw-fellowship-step p,
    .llw-fellowship-step li,
    .llw-modal-content label,
    .llw-modal-content p,
    .llw-fellowship-form-wrapper input,
    .llw-fellowship-form-wrapper select,
    .llw-fellowship-form-wrapper textarea,
    .llw-modal input,
    .llw-modal select,
    .llw-modal textarea {
        font-size: 16px;
        line-height: 1.55;
    }
    /* The description lines sit a step below body text but stay legible. */
    .llw-fellowship-step .description,
    .llw-modal-content .description {
        font-size: 15px;
    }
}

/* ============================================================
   Field widths — rows that add up
   ============================================================ */
/* Only 33 / 50 / 66 / 100 are used, so every row totals 100%.
   .llw-field-width-66 is new; the rest came with the stylesheet. */
.llw-field-width-66 { flex-basis: calc(66.666% - 8px); min-width: 260px; }

/* 25 and 37 are deliberately not used by the wizard any more — they cannot
   combine into a full row with the others. Left defined for anything else
   that still references them. */

/* ============================================================
   CE credits — button and modal
   ============================================================ */
/* ADD NEW now matches the width of the table it belongs to. */
.llw-fellowship-step .llw-ce-add-actions {
    display: block;
    margin: 16px 0 0;
}
.llw-fellowship-step .llw-ce-add-actions .llw-ce-add-trigger {
    display: block;
    width: 100%;
    text-align: center;
}

/* The modal renders OUTSIDE .llw-fellowship-step, so rules scoped to the step
   never reached it — which is why the close button kept the theme's shape and
   background on hover. Scope to the modal itself. */
.llw-modal .llw-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease;
}
.llw-modal .llw-modal-close:hover,
.llw-modal .llw-modal-close:focus {
    /* Square, and its own colour — the theme's button background was showing
       through on hover and giving it a different shape from its resting state. */
    background: rgba(255, 255, 255, .3);
    color: #fff;
    box-shadow: none;
    transform: none;
}

/* ============================================================
   Attestation notes
   ============================================================ */
/* Full width regardless of what the theme does to textareas. */
.llw-fellowship-step textarea[name="notes"],
.llw-fellowship-step textarea.llw-notes-field {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-height: 130px;
    box-sizing: border-box;
}

/* ============================================================
   Field sizing — make inputs fill their column
   ------------------------------------------------------------
   The grid was placing fields in the right columns while the
   inputs themselves stayed at the browser's default ~180px, so
   every row read as a narrow box floating in a wide cell. The
   inline width:100% some fields carried was losing to a theme
   max-width, which caps a width without replacing it — hence
   !important here rather than a higher-specificity selector.
   ============================================================ */
.llw-fellowship-step .llw-form-grid > p,
.llw-modal-content .llw-form-grid > p {
    display: flex;
    flex-direction: column;
    margin: 0 0 18px;
}

/* A label wrapping its input is inline by default, so it never gives the
   input a block to fill. */
.llw-fellowship-step .llw-form-grid > p > label,
.llw-fellowship-step fieldset label,
.llw-modal-content label {
    display: block;
    width: 100%;
    font-weight: 600;
    margin-bottom: 4px;
}

.llw-fellowship-step input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.llw-fellowship-step select,
.llw-fellowship-step textarea,
.llw-modal-content input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.llw-modal-content select,
.llw-modal-content textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Declaration and file rows keep their own layout. */
.llw-fellowship-step .llw-declaration label,
.llw-fellowship-step .llw-qual-doc label {
    font-weight: 400;
}

/* Hints belong under the field, not wrapped around beside it. */
.llw-fellowship-step .description,
.llw-modal-content .description {
    display: block;
    margin-top: 4px;
    color: var(--llw-muted, #6b7684);
}

/* ============================================================
   Field chrome — one treatment across the plugin's forms
   ------------------------------------------------------------
   Matching assets/css/front.css, which is what the membership
   registration form uses and which reads considerably tidier
   than the wizard's square, hard-bordered boxes.
   ============================================================ */
.llw-fellowship-step input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.llw-fellowship-step select,
.llw-fellowship-step textarea,
.llw-modal-content input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.llw-modal-content select,
.llw-modal-content textarea {
    border: 1px solid #d4d8dd;
    border-radius: 9px;
    padding: 9px 12px;
    background: #fff;
    color: #1d2327;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.llw-fellowship-step input:focus,
.llw-fellowship-step select:focus,
.llw-fellowship-step textarea:focus,
.llw-modal-content input:focus,
.llw-modal-content select:focus,
.llw-modal-content textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, .15);
    outline: none;
}

/* Row rhythm: the grid gap does the spacing, so paragraphs inside it
   should not add their own on top. */
.llw-fellowship-step .llw-form-grid {
    row-gap: 4px;
}

/* The CE modal's rows carried their layout inline. Same behaviour, in the
   stylesheet, so the gap matches the wizard's grid. */
.llw-modal-content .llw-modal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    margin: 0 0 18px;
}
.llw-modal-content .llw-modal-row > label {
    flex: 1 1 180px;
    min-width: 0;
}
