/* ==========================================================================
   TehsilZone — Digital Seva Kendra
   Tokens
   ========================================================================== */
:root{
  --navy: #0f3d6b;
  --navy-dark: #0a2c4d;
  --blue: #1768ac;
  --blue-light: #eaf2fb;
  --blue-soft: #d7e7f7;
  --green: #1f8a4c;
  --green-dark: #166b3a;
  --white: #ffffff;
  --ink: #16232f;
  --gray: #5b6b7a;
  --gray-light: #8a97a3;
  --border: #dbe4ec;
  --bg: #f6f9fc;
  --danger: #c62828;

  --font-body: 'Mukta', 'Inter', system-ui, sans-serif;
  --font-ui: 'Inter', 'Mukta', system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 2px 10px rgba(15, 61, 107, 0.08), 0 1px 2px rgba(15,61,107,0.06);
  --shadow-raised: 0 10px 30px rgba(15, 61, 107, 0.14);

  --header-h: 68px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

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

h1, h2, h3{
  font-family: var(--font-body);
  color: var(--navy-dark);
  margin: 0 0 .5em;
  line-height: 1.25;
}

p{ margin: 0 0 1em; }

button{ font-family: inherit; }

a{ color: var(--blue); }

:focus-visible{
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

img{ max-width: 100%; display: block; }

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  box-shadow: 0 1px 0 var(--border), 0 4px 14px rgba(15,61,107,0.06);
}

.header-inner{
  max-width: 1160px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  text-align: left;
}

.brand-mark{
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--navy), var(--blue));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 20px;
}

.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-name{ font-family: var(--font-ui); font-weight: 700; font-size: 19px; color: var(--navy-dark); }
.brand-sub{ font-size: 12px; color: var(--gray); font-weight: 500; }

.nav-link{
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--navy-dark);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.nav-link:hover{ background: var(--blue-light); }
.nav-link.active{ color: var(--blue); background: var(--blue-light); }

/* Single menu button — always visible, at every screen size */
.hamburger{
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span{
  width: 20px;
  height: 2px;
  background: var(--navy-dark);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* Backdrop behind the open side menu */
.nav-overlay{
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 40, 0.4);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.nav-overlay.show{
  opacity: 1;
  pointer-events: auto;
}

/* Side menu — slides in from the right on every screen size */
.side-nav{
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(78vw, 300px);
  background: var(--white);
  box-shadow: -8px 0 30px rgba(15,61,107,0.18);
  z-index: 120;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 24px;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.side-nav.open{ transform: translateX(0); }

.side-nav-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.side-nav-title{ font-weight: 700; color: var(--navy-dark); font-size: 15px; }
.side-nav-close{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  color: var(--gray);
}
.side-nav-close:hover{ background: var(--blue-light); color: var(--navy); }

.side-nav .nav-link{
  text-align: right;
  padding: 14px 10px;
  font-size: 16.5px;
  border-bottom: 1px solid var(--blue-light);
}
.side-nav .nav-link:last-child{ border-bottom: none; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-dark);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  max-width: 92vw;
  text-align: center;
  box-shadow: var(--shadow-raised);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 200;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Layout / Views
   ========================================================================== */
main{
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.view-header{
  margin-bottom: 20px;
}

.back-btn{
  background: none;
  border: 1px solid var(--border);
  color: var(--navy);
  font-weight: 600;
  font-size: 14.5px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 14px;
}
.back-btn:hover{ background: var(--blue-light); }

.view-subtext{ color: var(--gray); max-width: 60ch; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero{
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  padding: 28px 4px 40px;
}

.hero-eyebrow{
  display: inline-block;
  color: var(--green-dark);
  background: #e7f5ec;
  font-weight: 600;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-text h1{
  font-size: clamp(28px, 6vw, 42px);
  letter-spacing: -0.01em;
}

.hero-sub{
  color: var(--gray);
  font-size: 16.5px;
  max-width: 52ch;
}

.hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.hero-art{ display: flex; justify-content: center; }

.doc-stack{
  position: relative;
  width: 240px;
  height: 260px;
}
.doc-card{
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.doc-card-3{ transform: rotate(-9deg) translate(6px, 10px); background: var(--blue-soft); }
.doc-card-2{ transform: rotate(6deg) translate(-4px, 4px); background: var(--blue-light); }
.doc-card-1{
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.doc-line{
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--blue-soft);
}
.doc-line-title{ width: 60%; height: 12px; background: var(--navy); opacity: .85; margin-bottom: 4px; }
.doc-line-short{ width: 40%; }

.doc-badge{
  position: absolute;
  bottom: -14px;
  right: -10px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(31,138,76,.35);
}

@media (min-width: 760px){
  .hero{
    grid-template-columns: 1.1fr 0.9fr;
    padding: 48px 4px 56px;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15.5px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{ background: var(--blue); color: var(--white); }
.btn-primary:hover{ background: var(--navy); }

.btn-secondary{ background: var(--green); color: var(--white); }
.btn-secondary:hover{ background: var(--green-dark); }

.btn-outline{ background: var(--white); color: var(--navy); border-color: var(--border); }
.btn-outline:hover{ border-color: var(--blue); color: var(--blue); }

.btn-block{ width: 100%; }

.link-btn{
  background: none;
  border: none;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
}

/* ==========================================================================
   Service grid / cards
   ========================================================================== */
.home-services{ margin-top: 44px; }

.section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2{ margin: 0; font-size: 22px; }

.service-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 620px){
  .service-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px){
  .service-grid{ grid-template-columns: repeat(3, 1fr); }
}

.service-card{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-icon{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.service-card h3{ font-size: 17.5px; margin: 4px 0 2px; }
.service-card p{ color: var(--gray); font-size: 14.5px; margin: 0 0 8px; flex-grow: 1; }

.service-card .btn{ align-self: flex-start; padding: 10px 18px; font-size: 14.5px; min-height: 42px; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-card{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px 26px;
  box-shadow: var(--shadow-card);
}

@media (min-width: 640px){
  .form-card{ padding: 30px; }
}

.form-section{
  border: none;
  padding: 0;
  margin: 0 0 26px;
}
.form-section legend{
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  text-transform: none;
  padding: 0 0 10px;
  border-bottom: 2px solid var(--blue-light);
  width: 100%;
  margin-bottom: 16px;
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 700px){
  .form-grid{ grid-template-columns: 1fr 1fr; }
  .form-grid .span-2{ grid-column: 1 / -1; }
}

.form-field{ display: flex; flex-direction: column; gap: 6px; }
.form-field > label{ font-weight: 600; font-size: 14.5px; color: var(--ink); }
.req{ color: var(--danger); }

input[type="text"],
input[type="date"],
input[type="tel"],
select{
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  min-height: 48px;
  width: 100%;
}
input:focus, select:focus{
  border-color: var(--blue);
}
input.invalid, select.invalid{
  border-color: var(--danger);
}

.field-error{
  color: var(--danger);
  font-size: 13.5px;
  margin: 0;
  min-height: 0;
}

.form-card > .form-field{ margin-bottom: 24px; max-width: 320px; }

.form-actions{ margin-top: 4px; }

.form-success{
  margin-top: 14px;
  color: var(--green-dark);
  background: #e7f5ec;
  border: 1px solid #bfe4cc;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   Document preview (A4)
   ========================================================================== */
.doc-preview-wrap{ margin-top: 32px; }

.doc-preview-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 10;
}

.btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}

.print-gate-hint{
  color: var(--gray);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--blue-light);
  border: 1px solid var(--blue-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin: 0 0 16px;
}
.print-gate-hint[hidden]{ display: none; }

.a4-page{
  position: relative;
  background: var(--white);
  max-width: 800px;
  min-height: 1000px;
  margin: 0 auto;
  padding: 42px 38px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-raised);
  font-size: 15px;
  line-height: 1.9;
  color: #111;
  overflow: hidden;
}

.a4-watermark{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}
.a4-watermark span{
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 84px;
  letter-spacing: 3px;
  color: rgba(15, 61, 107, 0.08);
  transform: rotate(-32deg);
  white-space: nowrap;
}

.a4-corner-stamp{
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  border: 2px solid var(--danger);
  color: var(--danger);
  font-weight: 700;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 6px;
  transform: rotate(-6deg);
  letter-spacing: .5px;
}

.a4-body{ position: relative; z-index: 2; }

.draft-notice{
  margin-top: 18px;
  font-weight: 700;
  color: var(--danger);
  text-align: center;
  font-size: 13.5px;
  border-top: 1px dashed var(--danger);
  padding-top: 10px;
}

.a4-title{
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  text-decoration: underline;
  margin-bottom: 22px;
  color: var(--navy-dark);
}

.a4-body p{ text-align: justify; margin-bottom: 14px; }

.a4-table{
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  font-size: 14.5px;
}
.a4-table td{
  border: 1px solid #333;
  padding: 7px 10px;
}

.a4-meta{ margin-bottom: 20px; }

.a4-sign-row{
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  gap: 20px;
}
.a4-sign-box{
  text-align: center;
  min-width: 160px;
  border-top: 1px solid #333;
  padding-top: 6px;
  font-size: 14px;
}

/* ==========================================================================
   About / Contact
   ========================================================================== */
.about-card, .contact-card{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  max-width: 720px;
}

.about-points{
  margin: 14px 0 0;
  padding-right: 0;
  padding-left: 20px;
  color: var(--gray);
}
.about-points li{ margin-bottom: 6px; }

.contact-list{ margin: 0 0 20px; }
.contact-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--blue-light);
  flex-wrap: wrap;
}
.contact-row dt{ font-weight: 700; color: var(--navy); }
.contact-row dd{ margin: 0; color: var(--ink); }

.contact-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer{
  text-align: center;
  padding: 26px 16px 34px;
  color: var(--gray);
  font-size: 13.5px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.footer-credit{ margin-top: 4px; font-size: 12px; color: var(--gray-light); }

.owner-toggle{
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--gray-light);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px;
}
.owner-toggle:hover{ color: var(--blue); }

.owner-badge{
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 150;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-raised);
  max-width: 90vw;
}
.owner-badge[hidden]{ display: none; }

/* ==========================================================================
   View switching helper
   ========================================================================== */
.view[hidden]{ display: none !important; }

/* ==========================================================================
   Print styles — only the A4 document prints
   ========================================================================== */
@media print{
  body *{ visibility: hidden; }
  .a4-page, .a4-page *{ visibility: visible; }
  .a4-page{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    box-shadow: none;
    border: none;
    padding: 14mm 16mm;
  }
  .no-print, .site-header, .site-footer, .toast{ display: none !important; }
  @page{ size: A4; margin: 0; }
}
