/* ============================================================
   FORM.CSS — Apply Now / Registration Page
   Loaded only on apply.php, on top of the shared style.css.
   ============================================================ */

/* ---------------- Page Hero ---------------- */
.apply-hero {
    position: relative;
    padding: calc(var(--header-height) + 60px) 0 60px;
    background: linear-gradient(180deg, #fbf3e2 0%, #fffdf8 100%);
    text-align: center;
    overflow: hidden;
}

.apply-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(139,69,19,0.07) 1.6px, transparent 1.6px);
    background-size: 26px 26px;
    opacity: 0.6;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

.apply-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.apply-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 10px;
}

.apply-hero p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* ---------------- Form Wrapper ---------------- */
.application-form-section {
    padding: 20px 0 100px;
}

.application-form-wrap {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(139,69,19,0.07);
    padding: 46px;
}

/* ---------------- Form Sections ---------------- */
.form-section {
    padding-bottom: 34px;
    margin-bottom: 34px;
    border-bottom: 1px dashed rgba(139,69,19,0.16);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.section-num {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    color: var(--color-white);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.form-section-header h3 {
    font-size: 1.4rem;
    margin: 0;
}

.same-as-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-primary);
    cursor: pointer;
}

.same-as-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-secondary);
    cursor: pointer;
}

/* ---------------- Fields ---------------- */
.field-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.req {
    color: var(--color-devotional-red);
}

.field-input {
    width: 100%;
    padding: 13px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1.5px solid rgba(139,69,19,0.15);
    border-radius: var(--radius-sm);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
}

select.field-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238B4513'%3E%3Cpath d='M5.8 7.5L10 11.7l4.2-4.2 1.4 1.4L10 14.5 4.4 8.9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

.field-input::placeholder {
    color: var(--color-text-soft);
    opacity: 0.7;
}

.field-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(200,155,60,0.15);
}

.field-input.invalid {
    border-color: var(--color-devotional-red);
    background: rgba(255,59,48,0.05);
}

.field-input.invalid:focus {
    box-shadow: 0 0 0 4px rgba(255,59,48,0.14);
}

.field-input:disabled {
    background: var(--color-accent);
    color: var(--color-text-soft);
    cursor: not-allowed;
}

/* NEW — used instead of :disabled for the "Same as Communication
   Address" permanent fields, so their values still get submitted
   with the form (disabled fields are excluded from POST data). */
.field-input.field-locked {
    background: var(--color-accent);
    color: var(--color-text-soft);
    cursor: not-allowed;
    pointer-events: none;
}

/* ---------------- Field Errors ---------------- */
.field-error {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--color-devotional-red);
    font-size: 0.82rem;
    margin-top: 7px;
}

.field-error.show {
    display: flex;
    animation: errorFadeIn 0.25s ease;
}

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

/* ---------------- Radio Group (Relation) ---------------- */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: 1.5px solid rgba(139,69,19,0.15);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--color-bg);
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.radio-option input {
    accent-color: var(--color-secondary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.radio-option.active {
    border-color: var(--color-secondary);
    background: linear-gradient(135deg, rgba(200,155,60,0.16), rgba(139,69,19,0.1));
    color: var(--color-primary-dark);
}

/* ---------------- File Upload ---------------- */
.upload-area {
    position: relative;
    border: 1.5px dashed rgba(139,69,19,0.28);
    border-radius: var(--radius-md);
    padding: 26px 18px;
    text-align: center;
    background: var(--color-bg);
    transition: border-color 0.25s ease, background 0.25s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--color-secondary);
    background: var(--color-accent);
}

.upload-area.has-file {
    border-style: solid;
    border-color: var(--color-secondary);
    background: rgba(200,155,60,0.08);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 1.6rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-text strong {
    font-size: 0.92rem;
    color: var(--color-text);
    word-break: break-all;
}

.upload-text span {
    font-size: 0.78rem;
    color: var(--color-text-soft);
}

/* ---------------- Declaration ---------------- */
.declaration-wrap {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--color-accent);
    border: 1px solid rgba(139,69,19,0.12);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-top: 12px;
}

.declaration-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--color-secondary);
    cursor: pointer;
}

.declaration-text {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.6;
}

.declaration-text a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
}

.declaration-error {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--color-devotional-red);
    font-size: 0.82rem;
    margin-top: 8px;
}

.declaration-error.show {
    display: flex;
    animation: errorFadeIn 0.25s ease;
}

/* ---------------- Submit ---------------- */
.submit-wrap {
    text-align: center;
    margin-top: 40px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    padding: 18px 32px;
    border: none;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-devotional-red) 55%, var(--color-primary) 100%);
    color: var(--color-white);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    animation: pulseGlow 2.4s ease-in-out infinite;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.form-status-banner {
    display: none;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    margin: 0 auto 24px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-status-banner.show {
    display: flex;
}

.form-status-banner.error {
    background: rgba(255,59,48,0.08);
    color: var(--color-devotional-red);
    border: 1px solid rgba(255,59,48,0.25);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 767px) {
    .application-form-wrap {
        padding: 28px 20px;
        border-radius: var(--radius-md);
    }

    .form-section-header {
        gap: 12px;
    }

    .same-as-label {
        margin-left: 0;
        width: 100%;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-option {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .application-form-wrap {
        padding: 22px 16px;
    }

    .section-num {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .form-section-header h3 {
        font-size: 1.2rem;
    }
}

/* ============================================================
   NEW — TWO-STEP FORM ADDITIONS
   Everything below is additive only. Nothing above this line
   was changed. All new rules reuse existing design tokens
   (--color-*, --radius-*, --shadow-*, --font-*) so the look
   stays identical to the rest of the form.
   ============================================================ */

/* ---------------- Step Progress Indicator ---------------- */
.form-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 34px;
    font-family: var(--font-body);
}

.form-step-dot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-soft);
    transition: color 0.3s ease;
}

.form-step-dot .dot-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 1.5px solid rgba(139,69,19,0.2);
    color: var(--color-text-soft);
    font-weight: 700;
    font-size: 0.88rem;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.form-step-dot.active {
    color: var(--color-primary-dark);
}

.form-step-dot.active .dot-num {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    border-color: transparent;
    color: var(--color-white);
}

.form-step-line {
    width: 46px;
    height: 2px;
    background: rgba(139,69,19,0.18);
}

/* ---------------- Step Panels ---------------- */
.form-step-panel {
    display: none;
}

.form-step-panel.active {
    display: block;
    animation: stepFadeIn 0.35s ease;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------------- Payment / QR Block ---------------- */
.payment-qr-wrap {
    text-align: center;
    margin-bottom: 28px;
}

.payment-qr-wrap img {
    max-width: 230px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(139,69,19,0.15);
    box-shadow: var(--shadow-medium);
    padding: 10px;
    background: var(--color-white);
}

.payment-amount-banner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 18px auto 0;
    padding: 14px 24px;
    background: var(--color-accent);
    border: 1px solid rgba(139,69,19,0.14);
    border-radius: 100px;
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 0.98rem;
    text-align: center;
}

.payment-amount-banner i {
    color: var(--color-secondary);
}

/* ---------------- Step Nav (Back / Complete Registration) ---------------- */
.form-step-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.btn-step-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 16px 28px;
    border-radius: 100px;
    border: 1.5px solid rgba(139,69,19,0.2);
    background: var(--color-white);
    color: var(--color-primary);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.btn-step-back:hover {
    border-color: var(--color-secondary);
    background: var(--color-accent);
    transform: translateY(-2px);
}

.form-step-nav .btn-submit {
    flex: 1;
    width: auto;
}

@media (max-width: 480px) {
    .form-step-nav {
        flex-direction: column-reverse;
    }

    .btn-step-back {
        width: 100%;
        justify-content: center;
    }

    .form-step-nav .btn-submit {
        width: 100%;
    }
}

/* ============================================================
   NEW — THANK YOU PAGE
   Reuses the same card look as .application-form-wrap and the
   same .btn-submit button, so it matches the rest of the site.
   ============================================================ */
.thankyou-wrap {
    max-width: 640px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(139,69,19,0.07);
    padding: 60px 46px;
    text-align: center;
}

.thankyou-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    color: var(--color-white);
    font-size: 2.2rem;
    animation: thankyouPop 0.5s ease;
}

@keyframes thankyouPop {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

.thankyou-wrap h2 {
    font-size: 1.9rem;
    margin-bottom: 14px;
}

.thankyou-wrap p {
    font-size: 1rem;
    color: var(--color-text-soft);
    margin-bottom: 8px;
}

.thankyou-ref {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 28px;
    padding: 10px 20px;
    background: var(--color-accent);
    border: 1px solid rgba(139,69,19,0.14);
    border-radius: 100px;
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 0.9rem;
}

.thankyou-wrap .btn-submit {
    display: inline-flex;
    text-decoration: none;
    animation: none;
    width: auto;
    max-width: 320px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .thankyou-wrap {
        padding: 40px 22px;
    }
}

/* ============================================================
   NEW — POLICY PAGES (Terms & Privacy Policy / Refund Policy)
   Same card look as the rest of the site, built from existing
   color/radius/shadow/font tokens only.
   ============================================================ */
.policy-wrap {
    max-width: 820px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(139,69,19,0.07);
    padding: 46px;
}

.policy-updated {
    display: inline-block;
    margin-bottom: 24px;
    padding: 6px 16px;
    background: var(--color-accent);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.policy-wrap h2 {
    font-size: 1.5rem;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(139,69,19,0.16);
}

.policy-wrap h3 {
    font-size: 1.15rem;
    color: var(--color-primary-dark);
    margin: 28px 0 10px;
}

.policy-wrap h3:first-of-type {
    margin-top: 0;
}

.policy-wrap p {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 14px;
}

.policy-wrap ul {
    margin: 0 0 14px;
    padding-left: 20px;
}

.policy-wrap ul li {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 6px;
}

.policy-wrap a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
}

.policy-contact {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px dashed rgba(139,69,19,0.16);
}

@media (max-width: 480px) {
    .policy-wrap {
        padding: 28px 20px;
    }
}