/* ============================================================
   Pandit Todarmal Snatak Parishad — Letter Head Portal
   Clean, minimal (Google-Form-inspired) design.
   ============================================================ */

:root {
    --navy: #1a3a7a;
    --navy-dark: #142d5e;
    --accent: #1a3a7a;
    --bg: #f6f7fb;
    --card-bg: #ffffff;
    --text: #202124;
    --text-soft: #444a54;
    --muted: #70757e;
    --line: #dadce0;
    --line-soft: #e8eaed;
    --danger: #d93025;
    --success: #188038;
    --radius: 10px;
    --font: "Segoe UI", "Noto Sans Devanagari", Roboto, system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ---------- Header banner ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line-soft);
}
.site-header .banner-inner { max-width: 900px; margin: 0 auto; }
.top-banner { width: 100%; display: block; }

/* ---------- Layout ---------- */
.page-wrap { max-width: 640px; margin: 0 auto; padding: 26px 16px 64px; }

.intro { text-align: center; margin-bottom: 22px; }
.intro .badge-line { display: none; }
.intro h1 { font-size: 22px; font-weight: 600; color: var(--navy-dark); margin: 0 0 8px; line-height: 1.35; }
.intro p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 auto; max-width: 520px; }

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 14px;
}
.card label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}
.card .hint {
    display: block; font-weight: 400; font-size: 12.5px;
    color: var(--muted); margin-top: 5px;
}
.required { color: var(--danger); margin-left: 2px; }

/* ---------- Inputs (clean underline style) ---------- */
.card input[type="text"],
.card input[type="email"],
.card input[type="tel"],
.card select {
    width: 100%;
    padding: 9px 2px;
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    border: none;
    border-bottom: 1.5px solid var(--line);
    outline: none;
    background: transparent;
    border-radius: 0;
    transition: border-color .15s;
}
.card input:focus,
.card select:focus { border-bottom: 2px solid var(--accent); }
.card input::placeholder { color: #b0b4bb; }

.card select {
    appearance: none; -webkit-appearance: none;
    padding-right: 28px; cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D'12'%20height%3D'12'%20viewBox%3D'0%200%2020%2020'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20fill%3D'%235f6368'%20d%3D'M5%207l5%205%205-5z'%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 4px center;
}

/* ---------- International phone ---------- */
.phone-group { display: flex; flex-wrap: wrap; gap: 12px; }
.country-select { flex: 1 1 100%; }
.phone-sub {
    display: flex; flex: 1 1 100%; align-items: center;
    border-bottom: 1.5px solid var(--line); transition: border-color .15s;
}
.phone-sub:focus-within { border-bottom: 2px solid var(--accent); }
.phone-dial {
    font-size: 15px; font-weight: 600; color: var(--text-soft);
    padding-right: 12px; margin-right: 10px; border-right: 1px solid var(--line-soft);
    white-space: nowrap;
}
.phone-sub input {
    flex: 1; border: none !important; background: transparent !important;
    padding: 9px 2px; letter-spacing: .5px;
}

/* ---------- File upload ---------- */
.file-drop {
    border: 1px dashed var(--line); border-radius: 8px;
    padding: 20px 16px; text-align: center; cursor: pointer;
    transition: border-color .15s, background .15s; background: #fafbfc;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: #f5f7fc; }
.file-drop .file-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 20px; border-radius: 6px; background: var(--navy);
    color: #fff; font-size: 14px; font-weight: 600;
}
.file-drop .drop-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 10px; }
.file-drop input[type="file"] { display: none; }
.file-preview { margin-top: 14px; }
.file-preview img {
    max-height: 80px; max-width: 100%; border: 1px solid var(--line-soft);
    border-radius: 6px; padding: 6px; background: #fff;
}
.file-name { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* Batch short field */
.batch-input { max-width: 120px; text-align: left; letter-spacing: 2px; }

/* ---------- Submit ---------- */
.submit-row { text-align: center; margin-top: 22px; }
button.submit-btn {
    background: var(--navy); color: #fff; border: none;
    padding: 12px 44px; font-size: 15.5px; font-weight: 600;
    border-radius: 6px; cursor: pointer; transition: background .15s;
}
button.submit-btn:hover { background: var(--navy-dark); }
button.submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Messages ---------- */
.error-box {
    background: #fce8e6; border: 1px solid #f5c6c0; color: var(--danger);
    padding: 13px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px;
}
.error-box strong { display: block; margin-bottom: 4px; }
.error-box ul { margin: 6px 0 0; padding-left: 20px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 8px; display: none; }

/* ---------- Footer ---------- */
.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; line-height: 1.7; }
.footer-note a { color: var(--navy); font-weight: 600; text-decoration: none; }
.footer-note a:hover { text-decoration: underline; }
.footer-note .sep { color: var(--line); margin: 0 6px; }

/* ---------- Thank-you page ---------- */
.result-card {
    max-width: 540px; margin: 50px auto; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 40px 30px; text-align: center;
}
.result-card .icon-circle {
    width: 68px; height: 68px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; margin: 0 auto 18px;
    font-size: 34px; color: #fff;
}
.result-card.success .icon-circle { background: var(--success); }
.result-card.error .icon-circle { background: var(--danger); }
.result-card h2 { color: var(--text); font-weight: 600; margin: 0 0 10px; font-size: 20px; }
.result-card p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.download-btn {
    display: inline-flex; align-items: center; gap: 8px; margin: 22px 6px 0;
    background: var(--success); color: #fff; font-weight: 600; font-size: 15px;
    text-decoration: none; padding: 12px 26px; border-radius: 6px;
}
.download-btn:hover { background: #146c2e; }
.back-link {
    display: inline-block; margin: 22px 6px 0; background: var(--navy);
    color: #fff; font-weight: 600; text-decoration: none;
    padding: 12px 26px; border-radius: 6px;
}
.back-link:hover { background: var(--navy-dark); }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.admin-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.admin-bar h1 { font-size: 20px; font-weight: 600; color: var(--navy-dark); margin: 0; }
.admin-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-nav a { font-size: 13.5px; font-weight: 600; text-decoration: none; padding: 8px 15px; border-radius: 6px; }
.admin-nav a.nav-link { color: var(--navy); background: #eef1f8; }
.admin-nav a.nav-link.active { background: var(--navy); color: #fff; }
.admin-nav a.logout { color: var(--danger); background: #fce8e6; }

.stat-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 15px 18px; flex: 1; min-width: 130px; }
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.search-box { margin-bottom: 14px; }
.search-box input { padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; width: 320px; max-width: 100%; background: #fff; }

.admin-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th, table.admin-table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.admin-table th { background: #f5f7fb; color: var(--navy-dark); font-weight: 600; }
table.admin-table tr:hover td { background: #fafbff; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge.completed { background: #e6f4ea; color: var(--success); }
.badge.pending { background: #fef7e0; color: #a06c00; }
.badge.failed { background: #fce8e6; color: var(--danger); }
.mail-yes { color: var(--success); font-weight: 600; }
.mail-no { color: var(--danger); font-weight: 600; }
table.admin-table a.action { color: var(--navy); font-weight: 600; text-decoration: none; margin-right: 12px; }
table.admin-table a.action:hover { text-decoration: underline; }

.login-card {
    max-width: 380px; margin: 70px auto; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 30px;
}
.login-card .lock { text-align: center; font-size: 30px; margin-bottom: 8px; }
.login-card h1 { font-size: 19px; font-weight: 600; color: var(--navy-dark); margin: 0 0 18px; text-align: center; }
.login-card input[type="password"] { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 15px; margin-bottom: 14px; }
.login-card button { width: 100%; padding: 12px; background: var(--navy); color: #fff; border: none; border-radius: 6px; font-weight: 600; font-size: 15px; cursor: pointer; }

.settings-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; max-width: 640px; }
.settings-card h2 { color: var(--navy-dark); font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.settings-card .desc { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.settings-card label.field-label { display: block; font-weight: 600; color: var(--text); margin: 18px 0 8px; }
.settings-card textarea { width: 100%; min-height: 130px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: var(--font); resize: vertical; }
.radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-opt { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.radio-opt.active { border-color: var(--navy); background: #f5f7fc; }
.radio-opt strong { display: block; color: var(--text); font-size: 14.5px; }
.radio-opt span { font-size: 12.5px; color: var(--muted); }
.settings-card button.save { margin-top: 22px; background: var(--navy); color: #fff; border: none; padding: 12px 28px; border-radius: 6px; font-weight: 600; font-size: 15px; cursor: pointer; }

.flash { padding: 12px 16px; border-radius: 6px; font-size: 13.5px; margin-bottom: 16px; }
.flash.ok { background: #e6f4ea; color: var(--success); }
.flash.err { background: #fce8e6; color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) { .page-wrap { padding: 20px 13px 56px; } }
@media (max-width: 560px) {
    .intro { margin-bottom: 18px; }
    .intro h1 { font-size: 19px; }
    .intro p { font-size: 13px; }
    .card { padding: 18px 18px; margin-bottom: 12px; }
    .card label { font-size: 14.5px; }
    .card input, .card select, .phone-dial, .phone-sub input { font-size: 16px; } /* stops iOS zoom */
    button.submit-btn { width: 100%; padding: 14px; font-size: 16px; }
    .result-card { margin: 28px 13px; padding: 30px 20px; }
    .download-btn, .back-link { display: flex; justify-content: center; margin: 12px 0 0; }
    .admin-wrap { padding: 16px 12px 50px; }
}
@media (max-width: 380px) { .intro h1 { font-size: 18px; } .card { padding: 15px 14px; } }
