/* Dar-ul-Madinah Admission Form – Web page layout */
:root {
    --primary-green: #36A74C;
    --secondary-green: #256E31;
    --dark-bg: #0d0d0d;
    --text-on-dark: #e8e8e8;
    --input-border: #ddd;
    --input-focus: #36A74C;
    --error: #dc3545;
    --radius: 12px;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body.admission-page {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(160deg, #f5f7f5 0%, #eef3ee 40%, #f0f5f0 100%);
    min-height: 100vh;
    color: #333;
}

/* Header – web page style */
.form-header {
    background: linear-gradient(135deg, #0a0a0a 0%, #0f1810 50%, #0d0d0d 100%);
    color: var(--text-on-dark);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.form-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    animation: headerShine 3s ease-in-out infinite;
}

@keyframes headerShine {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.form-header-inner {
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.form-logo-link {
    display: inline-block;
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease-out;
}

.form-logo-img {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(54, 167, 76, 0.2));
}

.form-page-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--primary-green);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
    animation: fadeInDown 0.5s ease-out 0.1s both;
}

.form-page-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 1.5rem;
    animation: fadeInDown 0.5s ease-out 0.15s both;
}

.form-progress-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out 0.2s both;
}

.form-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    border-radius: 3px;
    transition: width var(--transition);
}

.form-steps-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    animation: fadeIn 0.5s ease-out 0.25s both;
}

.form-step-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-on-dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.form-step-item:hover {
    background: rgba(54, 167, 76, 0.2);
    border-color: var(--primary-green);
    color: #fff;
}

.form-step-item.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: #fff;
    box-shadow: 0 2px 12px rgba(54, 167, 76, 0.4);
}

.form-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.form-step-item.active .form-step-num {
    background: rgba(255, 255, 255, 0.35);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Main form area */
.form-main {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.form-container {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    animation: formSlideUp 0.6s ease-out;
}

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

.admission-form {
    position: relative;
}

.form-step {
    display: none;
    animation: stepFadeIn 0.45s ease-out;
}

.form-step.active {
    display: block;
}

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

.step-title {
    color: var(--secondary-green);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-green);
}

.form-label {
    font-weight: 500;
    color: #444;
}

.form-control,
.form-select {
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(54, 167, 76, 0.15);
    outline: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--error);
}

/* Date input: whole field opens calendar on click, works on all screen sizes */
.date-input-wrap {
    position: relative;
    display: block;
}

.date-input-wrap .form-control {
    position: relative;
    z-index: 1;
    min-height: 38px;
}

/* Hide native date placeholder when empty so only our overlay shows (prevents double placeholder) */
.date-input-wrap:not(.has-value) input[type="date"] {
    color: transparent;
}

.date-input-wrap.has-value input[type="date"] {
    color: inherit;
}

.date-input-wrap .date-input-overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    padding-left: 0.75rem;
    padding-right: 2.5rem;
    cursor: pointer;
    pointer-events: auto;
    border-radius: var(--radius);
}

.date-input-wrap .date-placeholder-text {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.5;
    user-select: none;
}

.date-input-wrap.has-value .date-input-overlay {
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 576px) {
    .date-input-wrap .date-input-overlay {
        padding-left: 0.65rem;
        padding-right: 2.25rem;
    }
    .date-input-wrap .date-placeholder-text {
        font-size: 0.9375rem;
    }
}

.invalid-feedback {
    font-size: 0.85rem;
    color: var(--error);
}

.permission-group {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.permission-group:last-of-type {
    border-bottom: none;
}

.declaration-text {
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    color: #444;
}

/* Yes/No conditional detail – animate in */
.yes-detail {
    overflow: hidden;
    animation: yesDetailSlide 0.35s ease-out;
}

@keyframes yesDetailSlide {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* Form navigation */
.form-nav {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.btn-prev,
.btn-next {
    min-width: 120px;
}

.btn-submit {
    display: none;
    min-width: 160px;
    background: var(--secondary-green);
    border-color: var(--secondary-green);
}

.btn-submit:hover {
    background: #1e5a28;
    border-color: #1e5a28;
}

.btn-primary {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-primary:hover {
    background: var(--secondary-green);
    border-color: var(--secondary-green);
}

.btn-outline-primary {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.btn-outline-primary:hover:not(:disabled) {
    background: rgba(54, 167, 76, 0.1);
    color: var(--secondary-green);
    border-color: var(--secondary-green);
}

.alert {
    border-radius: var(--radius);
}

.animate-in {
    animation: fadeIn 0.4s ease-out;
}

/* Review & Submit step */
.form-step-review .step-title {
    margin-bottom: 0.75rem;
}

.review-intro {
    color: #555;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.review-content {
    margin-bottom: 2rem;
}

.review-block {
    background: linear-gradient(135deg, #f8faf8 0%, #fff 100%);
    border: 1px solid #e8ece8;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    border-left: 4px solid var(--primary-green);
    animation: reviewBlockIn 0.4s ease-out both;
}

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

.review-block-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-green);
    margin: 0;
    padding: 0.75rem 1rem;
    background: rgba(54, 167, 76, 0.08);
}

.review-block-body {
    padding: 0.75rem 1rem 1rem;
}

.review-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.review-row:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 500;
    color: #555;
    min-width: 140px;
}

.review-value {
    color: #222;
}

.review-submit-wrap {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease-out 0.2s, transform 0.4s ease-out 0.2s;
}

.review-submit-wrap.review-submit-visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-submit-review {
    min-width: 200px;
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--secondary-green);
    border-color: var(--secondary-green);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(37, 110, 49, 0.35);
}

.btn-submit-review:hover {
    background: #1e5a28;
    border-color: #1e5a28;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 110, 49, 0.4);
}

.btn-submit-icon {
    font-size: 1.1rem;
}

/* Thank-you page compatibility */
.success-block {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.success-block.animate-in {
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .form-steps-nav {
        gap: 0.3rem;
    }

    .form-step-item {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    .form-container {
        padding: 1.5rem 1.25rem;
    }
}
