:root {
  --bg: #f4f0fd;
  --card: #ffffff;
  --text: #1e1238;
  --muted: #6b6185;
  --line: #e2daf5;
  --primary: #5b21d6;
  --primary-dark: #3b0f9c;
  --accent: #ffcc00;
  --brand-red: #e31e24;
  --like: #e0245e;
  --ok: #1f8a4c;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(45, 15, 110, 0.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Malayalam", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
button, input { font: inherit; }
a { color: var(--primary); }

.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.15rem; margin: 0; flex: 1; letter-spacing: .3px; }
.modal { z-index: 60; }
.topbar .back {
  background: rgba(255,255,255,.15);
  border: 0; color: #fff; border-radius: 10px;
  padding: 6px 12px; cursor: pointer;
}
.topbar .back[hidden] { display: none; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }

/* Home */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h2 { font-size: 1.7rem; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; }
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 720px;
  margin: 28px auto 0;
}
.choice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.choice:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(45,15,110,.18); }
.choice .icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 14px;
  font-size: 34px;
}
.choice.upload .icon { background: #ece4ff; }
.choice.like .icon { background: #fde0e8; }
.choice h3 { margin: 0 0 4px; font-size: 1.25rem; }
.choice p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Cards & forms */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 520px;
  margin: 0 auto;
}
.card h2 { margin-top: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field input[type=text], .field input[type=tel], .field input[type=password] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.field input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #ebe5f8; color: var(--text); }
.btn.secondary:hover { background: #ddd3f3; }

.quota {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff8d6; border: 1px solid #f5e08a;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: .95rem;
}
.quota strong { font-size: 1.1rem; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  background: #fbf9ff;
  margin-bottom: 14px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #f6f1ff; }
.dropzone img { max-width: 100%; max-height: 280px; border-radius: 10px; display: block; margin: 0 auto; }
.dropzone input { display: none; }

.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: .95rem; }
.msg.error { background: #fdecea; color: #a1281a; }
.msg.ok { background: #e6f5ec; color: var(--ok); }
.msg[hidden] { display: none; }

.done { text-align: center; padding: 30px 10px; }
.done .big { font-size: 46px; }

/* Gallery */
.gallery-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gallery-head h2 { margin: 0; }
.gallery-head span { color: var(--muted); font-size: .92rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.photo {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
}
.photo .img-wrap { aspect-ratio: 1 / 1; background: #ece6f8; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.photo:hover img { transform: scale(1.04); }
.photo .meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; gap: 8px; }
.photo .who { font-size: .9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .likes { display: flex; align-items: center; gap: 5px; font-weight: 700; flex-shrink: 0; }
.heart { color: #c9bab0; font-size: 1.2rem; line-height: 1; }
.photo.liked .heart { color: var(--like); }
.photo.liked::after {
  content: "Liked"; position: absolute; top: 10px; left: 10px;
  background: var(--like); color: #fff; font-size: .75rem; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
}
.empty { text-align: center; color: var(--muted); padding: 50px 10px; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(15,5,40,.65);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 50;
}
.modal[hidden] { display: none; }
.modal .sheet {
  background: var(--card); border-radius: var(--radius);
  width: 100%; max-width: 440px; max-height: 92vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal .sheet img { width: 100%; max-height: 50vh; object-fit: contain; background: #140b2b; display: block; }
.modal .body { padding: 18px; }
.modal .body h3 { margin: 0 0 4px; }
.modal .body .sub { color: var(--muted); margin: 0 0 14px; font-size: .92rem; }
.modal .row { display: flex; gap: 10px; }
.modal .row .btn { flex: 1; }

.spinner { text-align: center; color: var(--muted); padding: 40px; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 30px; }
.foot a { color: var(--muted); }

/* ================= Kerala Vision Broadband branding ================= */
.topbar {
  background: linear-gradient(135deg, #6a2be8 0%, #4512b8 60%, #2e0a85 100%);
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: #fff; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-weight: 900; font-size: .95rem; letter-spacing: -.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.brand-logo .k { color: var(--primary-dark); }
.brand-logo .v { color: var(--brand-red); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-size: 1rem; letter-spacing: .4px; white-space: nowrap; }
.brand-text strong span { color: var(--accent); }
.brand-text small { font-size: .75rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-call {
  background: var(--accent); color: #2a1300; text-decoration: none;
  font-weight: 800; border-radius: 99px; padding: 7px 12px; font-size: .85rem;
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.top-call:hover { filter: brightness(1.05); }

/* Hero promo on home page */
.promo-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 22px; align-items: center;
  background: linear-gradient(140deg, #7b3cf0, #4a14c0 55%, #2b0a80);
  border-radius: 22px; padding: 22px; color: #fff;
  box-shadow: 0 14px 40px rgba(60, 20, 160, .35);
  overflow: hidden; position: relative;
}
.promo-hero img { width: 100%; border-radius: 14px; display: block; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.cw-badge {
  display: inline-block; background: var(--accent); color: #3a0a8a; font-weight: 900;
  border-radius: 99px; padding: 5px 14px; font-size: .85rem; letter-spacing: .5px; margin-bottom: 10px;
}
.promo-hero h2 { font-size: 1.75rem; line-height: 1.3; margin: 0 0 8px; }
.promo-hero .ml-sub { margin: 0 0 14px; opacity: .92; }
.promo-hero .lead { margin: 0 0 16px; opacity: .9; }

.prizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.prize {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px; padding: 10px 6px; text-align: center; font-size: .78rem;
}
.prize b { display: block; font-size: .95rem; margin-top: 2px; }
.prize .ico { font-size: 1.5rem; }
.prize.bumper { background: var(--accent); color: #2a0a6a; border-color: var(--accent); }
.prize.bumper .tag { display: inline-block; background: #3b0f9c; color: #fff; border-radius: 99px; padding: 1px 8px; font-size: .65rem; font-weight: 800; }

.switch-line {
  display: inline-block; background: var(--accent); color: #2a0a6a; font-weight: 800;
  padding: 8px 16px; border-radius: 10px; margin-top: 4px;
}
.tc { font-size: .72rem; opacity: .7; margin-top: 8px; }

/* Highlighted contact numbers */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 22px 0 0; }
.contact-card {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: #fff; border: 2px solid var(--accent); border-radius: 16px;
  padding: 14px 16px; color: var(--text); box-shadow: 0 8px 22px rgba(255, 190, 0, .25);
  transition: transform .15s;
}
.contact-card:hover { transform: translateY(-2px); }
.contact-card .cico {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.4rem; flex-shrink: 0; color: #fff;
}
.contact-card.call .cico { background: var(--primary); }
.contact-card.wa .cico { background: #25d366; }
.contact-card.web .cico { background: var(--brand-red); }
.contact-card small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.contact-card .num { font-size: 1.35rem; font-weight: 900; letter-spacing: .5px; color: var(--primary-dark); }
.contact-card.web .num { font-size: 1rem; }

/* Compact promo ribbon on inner pages */
.promo-ribbon {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(120deg, #6a2be8, #3b0f9c); color: #fff;
  border-radius: 14px; padding: 10px 14px; margin: 0 auto 18px; max-width: 1100px;
  box-shadow: var(--shadow);
}
.promo-ribbon img { width: 54px; height: 68px; object-fit: cover; object-position: top; border-radius: 8px; flex-shrink: 0; }
.promo-ribbon .txt { flex: 1; min-width: 0; font-size: .88rem; }
.promo-ribbon .txt b { color: var(--accent); }
.promo-ribbon a { color: #2a0a6a; background: var(--accent); text-decoration: none; font-weight: 800; border-radius: 99px; padding: 6px 12px; white-space: nowrap; font-size: .85rem; }

/* Sticky contact bar at the bottom of every page */
body { padding-bottom: 74px; }
.contact-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 3px solid var(--accent);
  box-shadow: 0 -6px 20px rgba(45,15,110,.15);
  display: flex; justify-content: center; gap: 10px; padding: 9px 12px;
}
.contact-bar a {
  flex: 1; max-width: 300px; display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; border-radius: 12px; padding: 9px 10px; font-weight: 900; font-size: 1.02rem;
  letter-spacing: .3px; white-space: nowrap;
}
.contact-bar .call { background: var(--primary); color: #fff; }
.contact-bar .wa { background: #25d366; color: #fff; }
.contact-bar small { font-weight: 600; font-size: .7rem; opacity: .9; display: block; line-height: 1; }
.contact-bar .lbl { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }

.site-foot {
  text-align: center; color: var(--muted); font-size: .85rem; padding: 10px 16px 20px;
}
.site-foot a { color: var(--primary); font-weight: 700; }

@media (max-width: 760px) {
  .promo-hero { grid-template-columns: 1fr; padding: 16px; }
  .promo-hero h2 { font-size: 1.4rem; }
  .prizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prize { font-size: .7rem; padding: 8px 4px; }
  .prize b { font-size: .8rem; }
  .top-call .t { display: none; }
  .contact-bar a { font-size: .92rem; padding: 8px 6px; }
}
.ribbon-wrap { padding: 16px 16px 0; }
.ribbon-wrap:empty { display: none; }
.ribbon-wrap + main { padding-top: 0; }
.ribbon-wrap:empty + main { padding-top: 20px; }
.promo-ribbon { margin-bottom: 18px; }
