/* ==========================================================================
   Digital Kiosk — Collector Office
   Custom CSS (Bootstrap 5.3 is used only for grid/utility helpers + collapse)
   ========================================================================== */

:root {
    --navy: #0c3c78;
    --navy-dark: #082a54;
    --navy-darker: #041a38;
    --blue: #1565b0;
    --blue-light: #eaf3fc;
    --blue-tint: #f3f8fd;
    --border-soft: #e1e9f2;
    --text-muted: #5b6b82;
    --amber: #e2a710;
    --danger: #c0392b;
    --success: #1f8a4c;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 2px 10px rgba(12, 60, 120, 0.08);
    --shadow-pop: 0 10px 35px rgba(4, 26, 56, 0.35);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Poppins", system-ui, sans-serif;
    background: var(--navy-darker);
    color: #1c2b40;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
}

/* Minimal Scrollbar */
::-webkit-scrollbar {
    width: 2px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #b8c2cf;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8d99a8;
}

button {
    font-family: inherit;
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

.icon {
    width: 1.4em;
    height: 1.4em;
    display: inline-block;
    vertical-align: -0.25em;
}
.icon-sm {
    width: 1.1em;
    height: 1.1em;
}
.icon-lg {
    width: 2.6em;
    height: 2.6em;
}
.icon-speaker {
    width: 1.3em;
    height: 1.3em;
}

/* ---------------------------------------------------------------- frame */

.kiosk-backdrop {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: radial-gradient(
        circle at 50% -10%,
        #123f7a 0%,
        var(--navy-darker) 60%
    );
    padding: 18px 12px;
}

.kiosk-frame {
    width: 100%;
    max-width: 800px;
    background: #fff;
    border-radius: 26px;
    border: 10px solid var(--navy-dark);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------- header */

.kiosk-header {
    background: #fff;
    flex-shrink: 0;
}

.kiosk-header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid var(--navy);
    color: var(--navy);
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 6px 12px;
    min-height: 34px;
    white-space: nowrap;
}
.lang-toggle:active {
    transform: scale(0.95);
}

.speaker-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.speaker-btn:active {
    transform: scale(0.92);
}
.speaker-btn.is-speaking {
    background: var(--amber);
    animation: pulse-speak 1s ease-in-out infinite;
}
@keyframes pulse-speak {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(226, 167, 16, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(226, 167, 16, 0);
    }
}

.kiosk-header__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
}

.kiosk-header__logo {
    position: relative;
    flex: 0 0 auto;
    max-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosk-header__logo::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--blue);
    border-radius: 2px;
}

.kiosk-header__leaders {
    flex: 0 0 auto;
    width: 100%;
    max-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kiosk-header__logo img,
.kiosk-header__leaders img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.kiosk-header__title {
    flex: 1;
    text-align: left;
    min-width: 0;
    padding: 0 4px;
}
.kiosk-header__title h1 {
    font-size: clamp(1.1rem, 5vw, 2.5rem);
    font-weight: 800;
    color: var(--navy);
    margin: 0;
    line-height: 1.15;
}
.kiosk-header__title h2 {
    font-size: clamp(0.85rem, 3.6vw, 1.5rem);
    font-weight: 700;
    color: #fff;
    margin: 1px 0 0;
    line-height: 1.15;
}
.kiosk-header__title p {
    font-size: clamp(0.62rem, 2.6vw, 0.78rem);
    font-weight: 600;
    color: var(--blue);
    margin: 3px 0 0;
    letter-spacing: 0.2px;
}

/* --------------------------------------------------------------- subbar */

.kiosk-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 24px;
    background: var(--blue-tint);
    border-top: 1px solid var(--border-soft);
}
.subbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid var(--navy);
    color: var(--navy);
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 8px 14px;
    min-height: 40px;
}
.subbar-btn:active {
    transform: scale(0.95);
}
.subbar-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--navy-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- main */

.kiosk-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* --------------------------------------------------------------- hero */

.hero-carousel {
    position: relative;
}
.hero-carousel .carousel-item {

    min-height: 180px;
}
.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    padding: 0 6% 8%;
    background: linear-gradient(
        90deg,
        rgba(6, 30, 60, 0) 40%,
        rgba(6, 30, 60, 0.25) 100%
    );
}
.hero-caption h2 {
    color: #fff;
    font-weight: 800;
    font-size: clamp(1.1rem, 4.6vw, 1.7rem);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
    margin: 0;
    line-height: 1.25;
}
.hero-carousel .carousel-indicators {
    margin-bottom: 8px;
}
.hero-carousel .carousel-indicators [data-bs-target] {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #fff;
    opacity: 0.55;
    border: none;
}
.hero-carousel .carousel-indicators .active {
    opacity: 1;
    background-color: var(--amber);
    width: 11px;
    height: 11px;
}

/* --------------------------------------------------------------- welcome */

.welcome-block {
    text-align: left;
    padding: 18px 16px 6px;
}
.welcome-block h2 {
    color: var(--navy);
    font-weight: 800;
    font-size: clamp(1.15rem, 4.6vw, 1.5rem);
    margin: 0 0 2px;
}
.welcome-block h3 {
    color: var(--navy);
    font-weight: 700;
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    margin: 0 0 6px;
}
.welcome-block p {
    color: var(--text-muted);
    font-size: clamp(0.8rem, 3vw, 1rem);
    margin: 0;
}

/* --------------------------------------------------------------- cards */

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 14px 24px 4px;
}
@media (max-width: 460px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 14px 8px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease;
    min-height: 148px;
    justify-content: flex-start;
}

.service-card:hover {
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.2s ease;
}
.service-card:hover h4 {
    color: #fff;
}
.service-card:hover p {
    color: #fff;
}
.service-card:hover .service-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-card:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(12, 60, 120, 0.12);
}
.service-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.service-card__icon .icon {
    width: 26px;
    height: 26px;
}
.service-card h4 {
    font-size: clamp(0.72rem, 3vw, 1rem);
    font-weight: 700;
    color: var(--navy);
    margin: 8px 0 0;
    line-height: 1;
}
.service-card p {
    font-size: clamp(0.6rem, 2.4vw, 0.75rem);
    color: var(--text-muted);
    margin: 0;
    line-height: 1.25;
}

/* --------------------------------------------------------- quick actions */

.quick-actions {
    display: flex;
    gap: 8px;
    padding: 10px 24px 4px;
    flex-wrap: wrap;
}
.quick-btn {
    flex: 1 1 30%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid var(--blue-light);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    font-weight: 700;
    font-size: clamp(0.62rem, 2.5vw, 0.76rem);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    min-height: 50px;
    text-align: center;
}
.quick-btn:active {
    transform: scale(0.95);
}
.quick-btn__icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.quick-btn__icon .icon {
    width: 15px;
    height: 15px;
}

/* ------------------------------------------------------------- info row */

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 24px 16px;
}
.info-item {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-tint);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: clamp(0.62rem, 2.5vw, 0.85rem);
    color: var(--navy-dark);
    font-weight: 600;
    line-height: 1.25;
}
.info-item .icon {

    flex-shrink: 0;
}

/* --------------------------------------------------------------- promo */

.kiosk-promo {
    position: relative;
    flex-shrink: 0;
    line-height: 0;
}
.kiosk-promo::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 75%;
    background: linear-gradient(
        0deg,
        rgba(4, 26, 56, 0.82) 0%,
        rgba(4, 26, 56, 0.45) 50%,
        rgba(4, 26, 56, 0) 100%
    );
    pointer-events: none;
}
.kiosk-promo__img {
    width: 100%;
    display: block;
    object-fit: cover;
    object-position: center 30%;
}
.kiosk-promo__overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 8% 6% 9%;
    line-height: 1.15;
    text-align: right;
}
.kiosk-promo__overlay h3 {
    color: #fff;
    font-weight: 800;
    font-size: clamp(1rem, 4.4vw, 1.4rem);
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.kiosk-promo__overlay h4 {
    color: #ffd34d;
    font-weight: 800;
    font-size: clamp(1rem, 4.4vw, 1.4rem);
    margin: 0 0 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.kiosk-promo__overlay p {
    color: #eaf3fc;
    font-size: clamp(0.65rem, 2.6vw, 0.8rem);
    margin: 0 0 8px;
    font-weight: 500;
}
.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    color: var(--navy);
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    font-weight: 700;
    font-size: clamp(0.62rem, 2.4vw, 0.76rem);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.promo-btn:active {
    transform: scale(0.94);
}

/* ---------------------------------------------------------- inner pages */

.page-section {
    padding: 16px;
}
.page-heading {
    color: var(--navy);
    font-weight: 800;
    font-size: clamp(1.05rem, 4.4vw, 1.35rem);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-heading .icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.page-subheading {
    color: var(--text-muted);
    font-size: clamp(0.8rem, 3.2vw, 0.9rem);
    margin: 0 0 18px;
}

.kiosk-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 18px;
    margin-bottom: 16px;
}

.form-label {
    font-weight: 700;
    color: var(--navy-dark);
    font-size: 0.86rem;
    margin-bottom: 6px;
}
.form-control,
.form-select {
    min-height: 52px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-soft);
    font-size: 1rem;
    padding: 10px 14px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(21, 101, 176, 0.15);
}
textarea.form-control {
    min-height: 110px;
}

.btn-kiosk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 56px;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.02rem;
    box-shadow: 0 6px 18px rgba(12, 60, 120, 0.28);
}
.btn-kiosk:active {
    transform: scale(0.97);
}
.btn-kiosk:disabled {
    opacity: 0.6;
}

.btn-kiosk-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 56px;
    background: #fff;
    color: var(--navy);
    border: 2px solid var(--navy);
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.02rem;
}
.btn-kiosk-outline:active {
    transform: scale(0.97);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.category-chip {
    border: 1.5px solid var(--border-soft);
    background: #fff;
    color: var(--navy-dark);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 42px;
}
.category-chip.active,
.category-chip:active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.alert-kiosk {
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.alert-kiosk.success {
    background: #e9f7ef;
    color: var(--success);
    border: 1px solid #b9e6c9;
}
.alert-kiosk.danger {
    background: #fbeceb;
    color: var(--danger);
    border: 1px solid #f1c3bf;
}

/* ------------------------------------------------------------- success */

.success-panel {
    text-align: center;
    padding: 10px 4px 4px;
}
.success-panel .icon-lg {
    color: var(--success);
    width: 4rem;
    height: 4rem;
}
.success-panel h2 {
    color: var(--navy);
    font-weight: 800;
    font-size: clamp(1.1rem, 4.6vw, 1.4rem);
    margin: 10px 0 4px;
}
.success-panel p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 14px;
}
.complaint-number {
    display: inline-block;
    background: var(--blue-tint);
    border: 2px dashed var(--blue);
    border-radius: var(--radius-md);
    padding: 12px 22px;
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.qr-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 0 auto 18px;
}
.qr-box canvas {
    image-rendering: pixelated;
}
.qr-box span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ----------------------------------------------------------- officers */

.officer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 420px) {
    .officer-grid {
        grid-template-columns: 1fr;
    }
}
.officer-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 16px 12px;
    text-align: center;
}
.officer-card__avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}
.officer-card__avatar .icon {
    width: 30px;
    height: 30px;
}
.officer-card h4 {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 2px;
}
.officer-card .designation {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--blue);
    margin: 0 0 2px;
}
.officer-card .department {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 8px;
}
.officer-card .phone {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--navy-dark);
    background: var(--blue-tint);
    border-radius: 999px;
    padding: 5px 12px;
}
.leadership-strip {
    text-align: center;
    padding: 4px 0 18px;
}
.leadership-strip img {
    max-width: 260px;
    width: 80%;
    height: auto;
}

/* -------------------------------------------------------------- help */

.faq-item {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
}
.faq-question {
    width: 100%;
    text-align: left;
    background: var(--blue-tint);
    border: none;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
}
.faq-question .icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.faq-question[aria-expanded="true"] .icon {
    transform: rotate(90deg);
}
.faq-answer {
    padding: 12px 16px;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.help-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 18px;
}
.help-contact .icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.help-contact h4 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
}
.help-contact p {
    margin: 0;
    font-size: 0.78rem;
    opacity: 0.9;
}

/* ---------------------------------------------------------- inactivity */

.inactivity-modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 20, 40, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.inactivity-modal[hidden] {
    display: none;
}
.inactivity-modal__box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 30px 26px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-pop);
}
.inactivity-modal__box .icon-lg {
    color: var(--amber);
}
.inactivity-modal__box p {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin: 12px 0 18px;
    line-height: 1.5;
}
.btn-continue {
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 13px 34px;
    font-weight: 800;
    font-size: 0.98rem;
    min-height: 52px;
}
.btn-continue:active {
    transform: scale(0.96);
}

/* ---------------------------------------------------------------- toast */

.kiosk-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    background: var(--navy-darker);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    z-index: 3000;
    max-width: 90%;
    text-align: center;
}
.kiosk-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --------------------------------------------------------- language state */

html[data-lang="en"] [data-i18n],
html[data-lang="en"] [data-i18n-placeholder] {
    font-family: "Poppins", system-ui, sans-serif;
}

/* Utility for server-rendered bilingual content that isn't in the JS
   dictionary (e.g. officer directory pulled from the database/config). */
.lang-en {
    display: none;
}
html[data-lang="en"] .lang-hi {
    display: none;
}
html[data-lang="en"] .lang-en {
    display: inline;
}

/* ------------------------------------------------------------- schemes */

.schemes-intro {
    padding: 16px 24px 4px;
}

.dept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 24px 20px;
}
@media (max-width: 720px) {
    .dept-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 340px) {
    .dept-grid { grid-template-columns: repeat(2, 1fr); }
}

.dept-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1.5px solid #f0cf8f;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(180, 130, 20, 0.1);
    padding: 8px 7px 7px;
    min-height: 132px;
    text-align: left;
    transition: transform .12s ease, box-shadow .12s ease;
    overflow: hidden;
}
.dept-card:active {
    transform: scale(0.94);
    box-shadow: 0 1px 3px rgba(180, 130, 20, 0.15);
    background: #fffaf0;
}
.dept-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
}
.dept-card__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dept-card__icon .icon { width: 17px; height: 17px; }
.dept-card__tag {
    font-size: 0.48rem;
    font-weight: 700;
    color: #a8730c;
    background: #fff7e6;
    border: 1px solid #f0cf8f;
    border-radius: 999px;
    padding: 2px 6px;
    white-space: nowrap;
    line-height: 1.4;
}
.dept-card__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin: 7px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}
.dept-card__desc {
    font-size: 0.52rem;
    color: var(--text-muted);
    margin: 3px 0 0;
    line-height: 1.2;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.dept-detail {
    text-align: center;
    padding: 30px 16px;
}
.dept-detail .dept-detail__icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dept-detail .dept-detail__icon .icon { width: 34px; height: 34px; }
.dept-detail h2 {
    color: var(--navy);
    font-weight: 800;
    font-size: clamp(1rem, 4.2vw, 1.25rem);
    margin: 0 0 20px;
    line-height: 1.3;
}
.dept-detail .kiosk-card {
    text-align: left;
    max-width: 420px;
    margin: 0 auto 16px;
}

/* ------------------------------------------------------- scheme details */

.scheme-info-heading {
    text-align: center;
    padding: 20px 16px 0;
}
.scheme-info-heading h2 {
    color: var(--navy);
    font-weight: 800;
    font-size: clamp(1.2rem, 4.8vw, 1.6rem);
    margin: 0;
}
.scheme-info-heading__underline {
    width: 72px;
    height: 4px;
    background: linear-gradient(90deg, #f8c358, #e2790c);
    border-radius: 3px;
    margin: 10px auto 0;
}

.scheme-table-wrap {
    margin: 18px 16px 20px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.scheme-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.scheme-table thead th {
    background: linear-gradient(135deg, #f8c358 0%, #e2a710 100%);
    color: #5a3d05;
    font-weight: 800;
    font-size: clamp(0.8rem, 3vw, 0.95rem);
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #d99a1f;
}
.scheme-table tbody tr:not(:last-child) > td {
    border-bottom: 1px solid var(--border-soft);
}
.scheme-table td {
    padding: 8px 18px;
    font-size: clamp(0.82rem, 3vw, 1rem);
    vertical-align: top;
    font-weight: 500;
}
.scheme-table td.field-name {
    width: 36%;
    font-weight: 700;
    color: var(--navy-dark);
    background: #fbfaf6;
}
.scheme-table td.field-value {
    color: #33445a;
}
.scheme-table td.field-value ol {
    margin: 0;
    padding-left: 1.3rem;
}
.scheme-table td.field-value ol ol {
    margin-top: 4px;
    padding-left: 1.4rem;
    list-style-type: lower-alpha;
}
.scheme-table td.field-value li + li {
    margin-top: 4px;
}
.scheme-table a.scheme-link {
    display: inline-block;
    color: var(--blue);
    font-weight: 700;
    text-decoration: underline;
    word-break: break-word;
}
.scheme-table a.scheme-link + .scheme-link-url {
    display: block;
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-all;
}

@media (max-width: 480px) {
    .scheme-table td.field-name { width: 42%; }
    .scheme-table td { padding: 12px 12px; }
}

/* ============================================= voice typing + keyboard */

.kiosk-main {
    padding-bottom: var(--kiosk-kb-h, 0px);
    transition: padding-bottom 0.2s ease;
}

.kiosk-field-wrap {
    position: relative;
}
.form-control.has-actions {
    padding-right: 96px;
}
.form-control.has-actions:not(.has-mic) {
    padding-right: 52px;
}

.kiosk-field-actions {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 6px;
}
.kiosk-field-actions--textarea {
    top: 10px;
    transform: none;
}

.kiosk-kb-btn,
.kiosk-mic-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border-soft);
    background: var(--blue-light);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
.kiosk-kb-btn {
    font-size: 1.1rem;
}
.kiosk-mic-btn svg {
    width: 20px;
    height: 20px;
}
.kiosk-mic-btn.is-listening {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    animation: kiosk-mic-pulse 1.2s infinite;
}
@keyframes kiosk-mic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); }
    70% { box-shadow: 0 0 0 14px rgba(192, 57, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

/* ---- on-screen keyboard ------------------------------------------------ */

.kiosk-keyboard {
    /* left/width are set inline by JS to exactly match the form card's
       own box — these are just a fallback before that runs. */
    position: fixed;
    left: 0;
    width: 100%;
    max-width: 800px;
    bottom: 0;
    z-index: 1200;
    background: #f3f8fd;
    border: 1px solid var(--border-soft);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(4, 26, 56, 0.25);
    padding: 6px 6px calc(5px + env(safe-area-inset-bottom));
    overflow: visible;
    transform: translateY(110%);
    transition: transform 0.25s ease, left 0.15s ease, width 0.15s ease;
}
.kiosk-keyboard.is-open {
    transform: translateY(0);
}

.kiosk-keyboard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}
.kiosk-keyboard__tabs {
    display: flex;
    gap: 5px;
}
.kiosk-keyboard__tabs[hidden] {
    display: none;
}
.kiosk-keyboard__num-label {
    font-weight: 800;
    color: var(--navy);
    font-size: 0.82rem;
}
.kiosk-keyboard__tab {
    border: 1.5px solid var(--border-soft);
    background: #fff;
    color: var(--navy-dark);
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 0.7rem;
}
.kiosk-keyboard__tab.is-active {
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    border-color: transparent;
    color: #fff;
}
.kiosk-keyboard__close {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border-soft);
    background: #fff;
    color: var(--navy-dark);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.kiosk-keyboard__rows {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.kiosk-keyboard__row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    margin-top: 3px;
}
.kiosk-key {
    flex: 1 1 auto;
    min-width: 24px;
    min-height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy-dark);
}
.kiosk-key:active {
    background: var(--blue-light);
    transform: scale(0.96);
}
.kiosk-key--wide {
    flex: 6 1 auto;
}
.kiosk-key--fn {
    flex: 2 1 auto;
    background: var(--blue-light);
    color: var(--blue);
    font-size: 0.66rem;
}
.kiosk-key--fn.is-active {
    background: var(--blue);
    color: #fff;
}

/* ===================================================== OTP verification */

.otp-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(4, 26, 56, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.otp-modal-backdrop[hidden] {
    display: none;
}

.otp-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-pop);
    padding: 26px 22px 22px;
    text-align: center;
}

.otp-modal__close {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border-soft);
    background: #fff;
    color: var(--navy-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.otp-modal__icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otp-modal__title {
    color: var(--navy);
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.4;
    margin: 0 0 14px;
}
.otp-modal__title small {
    display: block;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
}

.otp-modal__sub {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 14px;
}
.otp-modal__sub small {
    display: block;
    font-size: 0.72rem;
    margin-top: 2px;
}
.otp-modal__sub strong {
    color: var(--navy);
}

.otp-modal__label {
    display: block;
    text-align: left;
    font-weight: 700;
    color: var(--navy-dark);
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.otp-modal__mobile-input,
.otp-modal__code-input {
    text-align: center;
    font-weight: 700;
    letter-spacing: 2px;
}
.otp-modal__code-input {
    font-size: 1.6rem;
    letter-spacing: 10px;
    border-color: var(--amber) !important;
}
.otp-modal__code-input:focus {
    box-shadow: 0 0 0 3px rgba(226, 167, 16, 0.25) !important;
}

.otp-modal__error {
    color: var(--danger);
    font-weight: 700;
    font-size: 0.8rem;
    text-align: left;
    margin: 6px 0 0;
}

.otp-modal__btn {
    margin-top: 16px;
}

.otp-modal__resend {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--amber);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px;
}
.otp-modal__resend:disabled {
    color: var(--text-muted);
    opacity: 0.7;
}

.otp-modal__step--success .otp-modal__success-icon {
    width: 64px;
    height: 64px;
    margin: 4px auto 12px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.otp-modal-open {
    overflow: hidden;
}
