:root {
    --green: #0d6b43;
    --green-dark: #095435;
    --green-soft: #edf7f1;

    --border: #c9ddd1;
    --text: #163428;
    --muted: #6c7d75;

    --danger: #c62828;
    --danger-bg: #fff3f3;

    --success: #146c43;
    --success-bg: #effaf4;

    --page: #f5f8f6;
    --white: #ffffff;

    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family:
        "Noto Sans Bengali",
        "Nirmala UI",
        "Vrinda",
        Arial,
        sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.page-shell {
    width: 100%;
    padding: 28px 16px 50px;
}

.form-card {
    width: min(100%, 980px);
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow:
        0 8px 30px rgba(13, 71, 46, 0.08);
    overflow: hidden;
}

.hero {
    padding: 28px 24px;
    text-align: center;
    background:
        linear-gradient(
            135deg,
            #087b4b,
            #0d6b43
        );
    color: #fff;
    border-bottom: 3px solid #d8b552;
}

.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    font-size: 24px;
}

.hero h1 {
    max-width: 720px;
    margin: 0 auto;
    font-size: clamp(19px, 3vw, 28px);
    line-height: 1.55;
    font-weight: 700;
}

.warning-box {
    margin: 22px 28px 0;
    padding: 15px 18px;
    background: #f0faf5;
    border: 1px solid #cae5d6;
    border-radius: 10px;
    color: #b3261e;
    line-height: 1.6;
}

.warning-box p {
    margin: 0;
}

.warning-box p + p {
    margin-top: 6px;
}

.success-box,
.error-box {
    margin: 18px 28px 0;
    padding: 15px 18px;
    border-radius: 10px;
}

.success-box {
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid #bfe4cf;
}

.reference {
    margin-top: 7px;
}

.error-box {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #f0c1c1;
}

.error-box ul {
    margin: 8px 0 0;
    padding-left: 22px;
}

form {
    padding: 26px 28px 30px;
}

.form-section,
.additional-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.additional-section {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid #dbe8e0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 10px;
    color: var(--green-dark);
    font-size: 21px;
    font-weight: 700;
    border-bottom: 1px solid #dbe8e0;
}

.section-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: var(--green-soft);
    border-radius: 9px;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.4;
}

.required {
    color: #d62020;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.field input {
    min-height: 50px;
    padding: 11px 14px;
}

.field textarea {
    min-height: 110px;
    padding: 13px 14px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #97a59e;
    opacity: 1;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--green);
    box-shadow:
        0 0 0 3px rgba(13, 107, 67, 0.10);
}

.label-row {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.label-row label {
    margin-bottom: 0;
}

.location-button {
    border: 0;
    background: transparent;
    color: var(--green);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.location-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.helper {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.location-status {
    color: var(--green);
}

.month-week {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.auto-value {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #d2e4d9;
    border-radius: var(--radius);
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 700;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid #dbe8e0;
}

.primary-button,
.secondary-button {
    min-height: 48px;
    padding: 11px 22px;
    border-radius: 11px;
    font-weight: 700;
    cursor: pointer;
}

.primary-button {
    border: 1px solid var(--green);
    background: var(--green);
    color: #fff;
}

.primary-button:hover {
    background: var(--green-dark);
}

.primary-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.secondary-button {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.honeypot {
    position: absolute !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

@media (max-width: 700px) {
    .page-shell {
        padding: 0;
    }

    .form-card {
        border-radius: 0;
        box-shadow: none;
    }

    .hero {
        padding: 22px 16px;
    }

    .warning-box,
    .success-box,
    .error-box {
        margin-left: 16px;
        margin-right: 16px;
    }

    form {
        padding: 22px 16px 28px;
    }

    .two-column {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
    }
}


.location-gate {
    margin: 22px 28px 4px;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid #c9ddd1;
    border-radius: 14px;
    background: #fbfdfc;
}

.gate-icon {
    font-size: 38px;
    margin-bottom: 6px;
}

.location-gate h2 {
    margin: 6px 0 10px;
    color: var(--green-dark);
}

.location-gate p {
    margin: 8px auto;
    max-width: 700px;
    line-height: 1.6;
}

.gate-note {
    color: var(--muted);
    font-size: 14px;
}

.gate-button {
    margin-top: 14px;
}

.gate-status {
    min-height: 24px;
    margin-top: 12px;
    color: var(--green-dark);
    font-weight: 600;
}

.gate-closed {
    margin-top: 10px;
    padding: 14px;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
}

.country-confirmed {
    margin: 18px 28px 0;
    padding: 10px 14px;
    color: var(--green-dark);
    background: var(--green-soft);
    border: 1px solid #cfe4d7;
    border-radius: 10px;
}

.public-footer {
    padding: 0 28px 26px;
    text-align: center;
}

.public-footer a {
    color: var(--green);
    text-decoration: none;
    font-weight: 700;
}

.public-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .location-gate,
    .country-confirmed {
        margin-left: 16px;
        margin-right: 16px;
    }

    .public-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* v4 branding assets: upload logo.png, favicon.png, banner.png, background.png to /assets/images/ */
body {
    background-color: var(--page);
    background-image: linear-gradient(rgba(245,248,246,.92), rgba(245,248,246,.92)), url('/assets/images/background.png');
    background-repeat: repeat;
    background-size: auto, 520px auto;
    background-attachment: fixed;
}

.branded-hero {
    position: relative;
    background-image:
        linear-gradient(rgba(7,103,61,.78), rgba(7,103,61,.84)),
        url('/assets/images/banner.png');
    background-size: cover;
    background-position: center;
}

.hero-brand-logo {
    display: block;
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,.9);
    background-image: url('/assets/images/logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.edit-reference {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
}

.edit-result-card { max-width: 760px; }
.edit-success-box { margin-bottom: 0; }
.edit-result-actions { padding: 22px 28px 28px; text-align: center; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.edit-warning-box { color: #7a4d00; }
.edit-error-box { margin-bottom: 24px; }


/* IPEMIS-style school directory filter */
.warning-lines p { margin: 0; font-weight: 700; }
.warning-lines p + p { margin-top: 4px; }
@media (min-width: 701px) { .warning-lines p { white-space: nowrap; } }

.ipemis-directory-selector {
    padding: 18px;
    border: 1px solid #c7dfd1;
    border-radius: 13px;
    background: #f8fcf9;
    margin-bottom: 18px;
}
.ipemis-directory-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ipemis-directory-header > div { display: grid; gap: 3px; }
.ipemis-directory-header strong { color: var(--green-dark); font-size: 19px; }
.ipemis-directory-header span { color: var(--muted); font-size: 13px; }
.ipemis-directory-panel[hidden], .ipemis-selected-card[hidden], .ipemis-manual-banner[hidden], .ipemis-simple-results[hidden] { display: none !important; }
.ipemis-filter-grid { display: grid; gap: 14px; }
.ipemis-filter-grid-geo { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ipemis-filter-grid-search { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.compact-field { margin: 0; }
.compact-field label { display: block; margin-bottom: 7px; font-weight: 700; }
.compact-field input, .compact-field select {
    width: 100%; min-height: 46px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--text); font: inherit;
}
.compact-field input:focus, .compact-field select:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(13,107,67,.10); }
.compact-field select:disabled { background: #f2f5f3; color: #8a9891; cursor: not-allowed; }
.ipemis-filter-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.ipemis-filter-actions button { min-width: 180px; }
.ipemis-simple-status { min-height: 20px; margin-top: 12px; }
.ipemis-simple-results { display: grid; gap: 8px; margin-top: 12px; }
.ipemis-simple-result {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 12px; border: 1px solid #d6e9de; border-radius: 11px; background: #fff;
}
.ipemis-simple-result > div { min-width: 0; display: grid; gap: 3px; }
.ipemis-simple-result strong { color: var(--green-dark); line-height: 1.4; }
.ipemis-simple-result small { color: var(--muted); line-height: 1.45; }
.ipemis-selected-card, .ipemis-manual-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px; border: 1px solid #b8ddc7; border-radius: 12px; background: #eefaf3;
}
.ipemis-selected-card > div { min-width: 0; display: grid; gap: 4px; }
.ipemis-selected-label { color: #557267; font-size: .82rem; font-weight: 700; }
.ipemis-selected-card strong { color: #07583e; line-height: 1.45; }
.ipemis-selected-card small { color: #526b61; line-height: 1.45; }
.ipemis-manual-link { margin-top: 14px; }
textarea[readonly] { background: #f4f8f5; }

@media (max-width: 980px) {
    .ipemis-filter-grid-geo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ipemis-filter-grid-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .warning-lines p { white-space: normal; }
    .ipemis-filter-grid-geo, .ipemis-filter-grid-search { grid-template-columns: 1fr; }
    .ipemis-filter-actions { flex-direction: column-reverse; }
    .ipemis-filter-actions button, .ipemis-simple-result button, .ipemis-selected-card button, .ipemis-manual-banner button { width: 100%; }
    .ipemis-simple-result, .ipemis-selected-card, .ipemis-manual-banner { align-items: stretch; flex-direction: column; }
}

/* v4.5.1 warning alignment + remarks heading cleanup */
.warning-box.warning-lines {
    text-align: center;
}

.warning-box.warning-lines p,
.warning-box.warning-lines strong {
    text-align: center;
}

.additional-section {
    /*
     * Section heading intentionally removed.
     * Keep spacing for the remarks field only.
     */
    padding-top: 18px;
}

/* v5.5.9 — সময়ভিত্তিক ফর্ম প্রবেশ ও স্থান/এলাকার নাম */
.form-time-open-banner,
.form-schedule-summary {
    display: grid;
    gap: 6px;
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #b8ddc7;
    border-radius: 14px;
    background: #f3fbf6;
    color: #0f5f3a;
}

.form-time-open-banner span,
.form-schedule-summary span {
    color: #46695a;
    line-height: 1.65;
}

.form-time-closed {
    border-color: #e2c8a4;
    background: #fffdf8;
}

.custom-closed-message {
    margin-top: 14px;
    text-align: left;
    line-height: 1.7;
}


/* v5.6.1 Bengali / English language selector */
.tp-language-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}
.public-language-switcher {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 1000;
    padding: 6px;
    border: 1px solid rgba(0, 95, 54, .18);
    border-radius: 14px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(0, 60, 34, .12);
    backdrop-filter: blur(10px);
}

.tp-language-form { margin: 0; }
.tp-language-switcher .tp-language-button {
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}
.tp-language-switcher .tp-language-button {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 9px;
    color: #0a603d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.tp-language-switcher .tp-language-button.active {
    color: #fff;
    background: #0a6b44;
}
@media (max-width: 700px) {
    .public-language-switcher {
        position: sticky;
        top: 4px;
        margin: 4px 8px 8px;
        justify-content: center;
    }
    .tp-language-switcher .tp-language-button { font-size: 11px; padding: 5px 7px; }
}
