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

/*
    Registration Wizard UI
    Used by register_volunteer.php and register_organization.php.

    Flow:
    - PHP prints all registration steps.
    - register_steps.js shows only one .wizard-step at a time.
    - The progress bar, validation, password visibility, toast, and final submit confirmation are handled in JS.
*/

:root {
    --ink: #10231f;
    --muted: #52645f;
    --primary: #047857;
    --primary-2: #059669;
    --primary-dark: #064e3b;
    --gold: #c89b3c;
    --paper: #ffffff;
    --paper-soft: #fbfdfc;
    --field: #ffffff;
    --line: #d9e7e1;
    --line-strong: #b9d3c9;
    --danger: #b91c1c;
    --success-soft: #ecfdf5;
    --shadow: 0 22px 70px rgba(7, 43, 34, 0.12);
    --shadow-soft: 0 10px 30px rgba(7, 43, 34, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', Inter, Arial, sans-serif;
    color: var(--ink);
    padding: 18px;
    background:
        radial-gradient(circle at 6% 8%, rgba(16, 185, 129, 0.18), transparent 28%),
        radial-gradient(circle at 92% 12%, rgba(200, 155, 60, 0.10), transparent 26%),
        linear-gradient(135deg, #edf8f3 0%, #f7fbf9 46%, #eef7f4 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(6, 78, 59, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 78, 59, 0.035) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.wizard-page {
    width: min(1480px, 100%);
    min-height: calc(100vh - 36px);
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.wizard-card {
    width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(185, 211, 201, 0.85);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.wizard-header {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 280px;
    align-items: center;
    gap: 24px;
    padding: 28px 34px 24px;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.76));
    border-bottom: 1px solid var(--line);
}

.back-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 6px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.back-link:hover {
    color: var(--primary-2);
}

.wizard-title-block {
    text-align: center;
}

.wizard-title-block h1,
.wizard-header h1 {
    color: var(--primary-dark);
    font-size: clamp(30px, 3.2vw, 48px);
    line-height: 1.02;
    letter-spacing: -0.055em;
    font-weight: 800;
    margin-bottom: 8px;
}

.wizard-title-block p,
.wizard-header p,
.step-desc,
.note {
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

.wizard-progress {
    justify-self: stretch;
    align-self: center;
}

.progress-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.progress-label {
    display: none;
}

.progress-section-text {
    width: 100%;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.progress-track {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: #e3ebe7;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    transition: width 0.28s ease;
}

.wizard-form {
    padding: 32px 34px 26px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: stepFade 0.18s ease-out;
}

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

.wizard-step h2 {
    font-size: clamp(23px, 2vw, 30px);
    line-height: 1.1;
    color: #0a1f1a;
    letter-spacing: -0.035em;
    font-weight: 750;
    margin-bottom: 8px;
}

.step-desc {
    margin-bottom: 22px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
}

.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 7px;
    color: #1d302b;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.015em;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--field);
    color: var(--ink);
    outline: none;
    font: 500 14px/1.3 'Plus Jakarta Sans', Inter, Arial, sans-serif;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
    color: #8a9b96;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-2);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

input.invalid,
select.invalid,
textarea.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.10);
}

input[readonly] {
    background: #f3f8f6;
    color: #52645f;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

/* Clean 2D password visibility button */
.password-toggle-wrap {
    position: relative;
}

.password-toggle-wrap input {
    padding-right: 46px !important;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 31px;
    height: 31px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f7fbf9;
    color: var(--primary-dark);
    cursor: pointer;
    transition: 0.18s ease;
}

.password-toggle-btn:hover {
    background: var(--success-soft);
    border-color: var(--primary-2);
}

.eye-icon {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

input[type='file'] {
    padding: 9px;
    background: #fbfdfc;
}

input[type='file']::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 10px;
    padding: 9px 13px;
    background: #e8f5ef;
    color: var(--primary-dark);
    font-weight: 700;
    cursor: pointer;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.choice-card input {
    display: none;
}

.choice-card span {
    display: block;
    min-height: 42px;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

.choice-card span:hover {
    border-color: var(--primary-2);
}

.choice-card input:checked + span {
    background: var(--success-soft);
    border-color: var(--primary-2);
    color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.10);
}

.mini-title {
    margin: 22px 0 12px;
    font-size: 16px;
    font-weight: 750;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.consent-area {
    margin-top: 18px;
}

.terms-box {
    padding: 16px;
    border: 1px solid #badccc;
    border-radius: 16px;
    background: linear-gradient(135deg, #f1fcf7, #ffffff);
    color: #214039;
    box-shadow: var(--shadow-soft);
    margin-bottom: 14px;
}

.terms-box h3 {
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 780;
    margin-bottom: 8px;
}

.terms-box p {
    font-size: 13px;
    line-height: 1.55;
    color: #41554f;
    margin-top: 8px;
}

.consent-box {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: #263b35;
    margin-bottom: 10px;
}

.consent-box input {
    width: auto;
    min-height: auto;
    margin-top: 2px;
    accent-color: var(--primary);
}

.consent-box span {
    font-size: 13px;
    line-height: 1.5;
}

.note {
    font-size: 13px;
    margin-top: 10px;
}

.wizard-actions {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    min-width: 104px;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font: 750 14px/1 'Plus Jakarta Sans', Inter, Arial, sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #047857, #00684d);
    box-shadow: 0 14px 28px rgba(4, 120, 87, 0.24);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(4, 120, 87, 0.30);
}

.btn-secondary {
    color: #233832;
    background: #e8eef0;
}

.btn-secondary:hover {
    background: #dbe5e7;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 10000;
    max-width: 360px;
    padding: 13px 16px;
    border-radius: 14px;
    background: #10231f;
    color: white;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    font-size: 13px;
    font-weight: 650;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.22s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(16, 35, 31, 0.45);
    backdrop-filter: blur(8px);
}

.confirm-modal.show {
    display: flex;
}

.confirm-box {
    width: min(430px, 100%);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.confirm-box h3 {
    color: var(--primary-dark);
    font-size: 22px;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.confirm-box p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 980px) {
    body {
        padding: 12px;
    }

    .wizard-page {
        align-items: flex-start;
    }

    .wizard-header {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 24px 20px 20px;
    }

    .back-link {
        justify-self: center;
    }

    .wizard-progress {
        max-width: 360px;
        margin: 0 auto;
        width: 100%;
    }

    .progress-section-text {
        text-align: center;
    }

    .wizard-form {
        padding: 24px 20px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .wizard-card {
        border-radius: 18px;
    }

    .wizard-title-block h1,
    .wizard-header h1 {
        font-size: 30px;
    }

    .wizard-actions,
    .confirm-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }
}

/* Added polish: readable errors, cleaner uploads, and no horizontal overflow */
.form-alert {
    margin: 0 0 18px;
    padding: 13px 15px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.form-alert.error,
.step-inline-alert {
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #991b1b;
}

.step-inline-alert {
    display: none;
    margin: -8px 0 18px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
}

.choice-grid-error {
    padding: 10px;
    border: 1px dashed #ef4444;
    border-radius: 16px;
    background: #fff7f7;
}

.upload-grid {
    align-items: stretch;
}

.upload-disclaimer,
.file-upload-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.upload-disclaimer {
    padding: 14px 16px;
    margin-bottom: 16px;
}

.upload-disclaimer strong {
    display: block;
    color: var(--primary-dark);
    font-size: 14px;
    margin-bottom: 6px;
}

.upload-disclaimer p,
.field-hint {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.file-upload-card {
    padding: 16px;
}

.file-upload-card input[type='file'] {
    margin-top: 10px;
    border-style: dashed;
    background: #fbfdfc;
}

select:required:invalid {
    color: #80918c;
}

.wizard-page,
.wizard-card,
.wizard-form,
.grid,
.choice-grid {
    max-width: 100%;
}

@media (min-width: 981px) {
    .wizard-page {
        align-items: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }
}

.form-alert.success {
    border: 1px solid #bbf7d0;
    background: #ecfdf5;
    color: #166534;
}

.auth-center-page {
    justify-content: center;
}

.otp-card {
    max-width: 720px;
    margin: auto;
}

.otp-header {
    grid-template-columns: 130px minmax(0, 1fr) 130px;
}

.email-box-clean {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f7fbf9;
    margin-bottom: 18px;
}

.email-box-clean span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.email-box-clean strong {
    color: var(--primary-dark);
    font-size: 15px;
}

.otp-form input {
    text-align: center;
    font-size: 22px;
    letter-spacing: 0.22em;
    font-weight: 800;
}

.otp-actions {
    justify-content: space-between;
}


/* final polish patch */
.profile-avatar img,.org-profile-mini img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}.org-profile-mini{width:54px;height:54px;border-radius:18px;background:#eafaf1;border:1px solid #b9efd1;display:grid;place-items:center;font-weight:900;color:#087a46;margin-right:12px;flex:0 0 auto}.section-head{align-items:center}.summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.compact-table-wrap,.table-card,.volunteer-table-wrap{overflow-x:visible!important}.compact-table,.volunteer-table{min-width:0!important;width:100%!important;table-layout:auto}.volunteer-table th,.volunteer-table td,.compact-table th,.compact-table td{white-space:normal!important}.attendance-hours-input{max-width:110px}.terms-link{border:0;background:transparent;color:#087a46;font-weight:900;text-decoration:underline;cursor:pointer;padding:0}.terms-modal{position:fixed;inset:0;background:rgba(15,23,42,.58);display:none;align-items:center;justify-content:center;z-index:9999;padding:24px}.terms-modal.is-open{display:flex}.terms-modal-card{background:#fff;width:min(760px,96vw);max-height:82vh;overflow:auto;border-radius:24px;padding:30px;box-shadow:0 24px 70px rgba(15,23,42,.26);color:#0f172a}.terms-modal-card h2{margin:0 0 14px;color:#064e3b}.terms-modal-card p{line-height:1.7;color:#475569}.terms-modal-close{float:right;width:42px;height:42px;border-radius:14px;border:1px solid #dbe6ef;background:#fff;font-size:26px;cursor:pointer}.auth-form-grid .full-row{grid-column:1/-1}@media(max-width:1100px){.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){.summary-grid{grid-template-columns:1fr}}
