/* Krishna Costume Contest — ISKCON Samskriti integration layer.
   organic-styles.css (design system) and contest.css (page styles) are kept
   verbatim from the design handoff so they can be re-dropped on a redesign.
   Everything in THIS file exists only because the live site is PHP-driven:
   markup produced by manage_process.php, jQuery-toggled blocks, the jQuery UI
   datepicker, reCAPTCHA, and the secondary pages (vote / re-upload /
   confirmation / failed). All values come from the design tokens. */

/* ── Shared helpers ─────────────────────────────────────────────── */
.req { color: var(--color-accent-700); font-weight: 700; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }

/* Extra anchors used by the PHP pages */
#steps, #videos, #contactus { scroll-margin-top: 74px; }

/* The handoff runs the audience split straight into the key-dates panel, so
   the two read as one block. Restore the section rhythm used everywhere else. */
.audience-section { padding-bottom: var(--space-8); }

/* ── Countdown band: existing .countdown[data-target] markup ────── */
.countdown-band .countdown { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.cd-cell {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--color-accent-2-700);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cd-cell .n { font-family: var(--font-heading); font-size: 30px; color: var(--color-bg); line-height: 1; }
.cd-cell .u {
  font-size: 11px; color: var(--color-accent-2-300);
  text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px;
}
.countdown-side { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.countdown-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-accent-2-400);
}
.entries-stat {
  display: flex; align-items: baseline; gap: var(--space-3);
  background: var(--color-accent-2-700); border-radius: 999px;
  padding: 10px 24px;
}
.entries-stat .num { font-family: var(--font-heading); font-size: 32px; color: var(--color-bg); line-height: 1; }
.entries-stat .lbl { font-size: 14px; color: var(--color-accent-2-200); }

/* ── Registration form ──────────────────────────────────────────── */
/* Native selects get the system's pill treatment plus a token-coloured caret */
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c491a' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field input.input[readonly] { cursor: pointer; background: var(--color-surface); }
/* Boy / Girl fills its column so it lines up with the field beside it */
.field > .seg { display: flex; width: 100%; }
#othRelation { display: none; }

/* Photo picker — reuses #img-container / #img-preview so preview_images()
   and checkimg() in custom.js keep working untouched. */
.photo-drop { position: relative; }
.photo-drop .img-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
#img-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2); height: 232px;
  border: 2px dashed var(--color-neutral-400); border-radius: 18px;
  background: var(--color-neutral-100);
  cursor: pointer; text-align: center; padding: var(--space-4);
  color: var(--color-neutral-700); font-size: 14px;
}
#img-container:hover, #img-container.dragover { border-color: var(--color-accent); background: var(--color-accent-100); }
#img-container .form-img { color: var(--color-accent); }
#img-container .form-img img.photos { width: 54px; height: auto; margin: 0 auto; opacity: 0.7; }
.upload-para { margin: 0; font-size: 14px; line-height: 1.5; }
.upload-para span { display: block; font-size: 12px; color: var(--color-neutral-600); }
.upload-para span.req { display: inline; font-size: inherit; }
#img-preview {
  display: none; position: relative; height: 232px;
  border-radius: 18px; overflow: hidden; cursor: pointer;
  background: var(--color-neutral-200);
}
#img-preview .form-img { height: 100%; }
#img-preview img.photos { width: 100%; height: 100%; object-fit: cover; }
#img-preview .remvimg {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-neutral-900) 62%, transparent);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
#img-preview::after {
  content: "Tap the photo to choose a different one";
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  border-radius: 999px; padding: 6px 14px;
  font-size: 12px; font-weight: 600; text-align: center; color: var(--color-neutral-800);
}
.errortext {
  display: block; margin-top: var(--space-2);
  font-size: 13px; font-weight: 600; color: var(--color-accent-700);
}
.errortext:empty { display: none; }

.captcha-row { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.capchatext { font-size: 13px; font-weight: 600; color: var(--color-accent-700); }
.form-footer .error { margin: 0; font-size: 13px; font-weight: 600; color: var(--color-accent-700); }
.form-footer .error:empty { display: none; }

/* Registration window closed */
.closed-note {
  display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start;
  background: var(--color-accent-100); border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.closed-note h3 { margin: 0; font-size: 26px; color: var(--color-accent-800); }
.closed-note p { margin: 0; line-height: 1.6; color: var(--color-neutral-800); }

/* ── Voting console rendered by manage_process.php ───────────────── */
.gallery-search .search-glass { flex: none; }
.gallery-search .search__icon {
  display: none; flex: none; border: 0; background: none; cursor: pointer;
  padding: 0; width: 26px; height: 26px; border-radius: 50%;
  color: var(--color-neutral-700);
  align-items: center; justify-content: center;
}
.gallery-search .search__icon.fa-close { display: flex; }
.gallery-search .search__icon:hover { background: var(--color-neutral-200); color: var(--color-accent-700); }

/* The photo is presentational here (no lightbox in this build) — drop the
   button affordances contest.css gives .entry-photo. */
div.entry-photo { cursor: default; }
div.entry-photo::after { display: none; }
div.entry-photo:hover img { transform: none; }

.entry-votes {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--color-accent-700);
}
.entry-votes svg { width: 14px; height: 14px; flex: none; }
.entry-card-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.entry-card-actions .vote-btn { flex: none; width: 100%; }
.share-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.share-row .share-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-neutral-600); margin-right: 2px;
}
.share-link {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface); border: 1px solid var(--color-divider);
  color: var(--color-neutral-700);
}
.share-link svg { width: 15px; height: 15px; }
.share-link:hover { background: var(--color-accent); border-color: transparent; color: var(--color-bg); }

.gallery-nodata {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-8) 0; text-align: center;
}
.gallery-nodata .nodata-img { max-width: 240px; }
.gallery-nodata p { margin: 0; color: var(--color-neutral-700); }
.loadmore-row { display: flex; justify-content: center; margin-top: var(--space-8); }

/* ── Vote modal (WhatsApp OTP) ──────────────────────────────────── */
.vote-modal .mobile-div, .vote-modal .otpdiv { width: 100%; }
.vote-modal .otpdiv { display: none; }
.vote-modal .otp-box { width: 54px; height: 60px; }
/* The dialling-code picker has less room here than in the registration
   form, so it gives its width back to the number itself. */
.vote-modal .phone-code { min-width: 96px; }
#errorMsg, .error-otp, .success-otp {
  display: block; margin: 0; font-size: 13px; font-weight: 600;
}
#errorMsg, .error-otp { color: var(--color-accent-700); }
.success-otp { color: var(--color-accent-2-700); }
#errorMsg:empty, .error-otp:empty, .success-otp:empty { display: none; }
.sendnum { font-weight: 700; }
.vote-modal .btn-resend { margin-top: 0; }

/* ── jQuery UI datepicker, retuned to the design tokens ─────────── */
.ui-datepicker {
  width: 268px; padding: var(--space-2);
  background: var(--color-bg); border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-family: var(--font-body); font-size: 14px; z-index: 130 !important;
}
.ui-datepicker .ui-datepicker-header {
  background: transparent; border: 0; padding: 4px 0 8px;
  font-family: var(--font-heading); color: var(--color-text);
}
.ui-datepicker .ui-datepicker-title { display: flex; gap: 6px; justify-content: center; }
.ui-datepicker .ui-datepicker-title select {
  font: inherit; font-size: 13px; padding: 3px 6px;
  border: 1px solid var(--color-divider); border-radius: 999px;
  background: var(--color-surface); color: var(--color-text);
}
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
  top: 6px; width: 28px; height: 28px; border: 0; background: var(--color-surface);
  border-radius: 50%; cursor: pointer;
}
.ui-datepicker .ui-datepicker-prev { left: 4px; }
.ui-datepicker .ui-datepicker-next { right: 4px; }
.ui-datepicker .ui-datepicker-prev:hover, .ui-datepicker .ui-datepicker-next:hover { background: var(--color-accent-200); }
.ui-datepicker table { font-size: 13px; margin: 0; width: 100%; table-layout: fixed; }
.ui-datepicker table th {
  color: var(--color-neutral-600); font-weight: 700; font-size: 11px;
  text-transform: uppercase; text-align: center; padding: 6px 0;
}
.ui-datepicker table td { padding: 2px; text-align: center; }
/* One notch more specific than jQuery UI's `.ui-datepicker td a` so the day
   numbers sit centred in their cell instead of hugging the right edge. */
.ui-datepicker table td a, .ui-datepicker table td span {
  display: block; padding: 7px 0; text-align: center;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--color-text); text-decoration: none; font-weight: 600;
}
/* jQuery UI stamps .ui-state-default on every selectable day, which paints a
   grey-bordered white chip via `.ui-widget-content .ui-state-default` (2
   classes). These selectors carry 2 classes + 3 elements so they outrank it. */
.ui-datepicker table td a.ui-state-default,
.ui-datepicker table td span.ui-state-default {
  border: 0; background: transparent; text-align: center; font-weight: 600;
}
.ui-datepicker table td a.ui-state-default { color: var(--color-text); }
.ui-datepicker table td span.ui-state-default,
.ui-datepicker table td.ui-state-disabled span { color: var(--color-neutral-500); }
.ui-datepicker table td a:hover,
.ui-datepicker table td a.ui-state-default:hover {
  background: var(--color-accent-200); color: var(--color-accent-800);
}
.ui-datepicker table td a.ui-state-active,
.ui-datepicker table td a.ui-state-highlight,
.ui-datepicker table td.ui-datepicker-today a.ui-state-default {
  background: var(--color-accent); color: var(--color-bg);
}

/* ══ Secondary pages: vote / re-upload / confirmation / failed ════ */
.page-band { max-width: 1000px; margin: 0 auto; padding: var(--space-8) var(--space-6); }
.page-band.wide { max-width: 1200px; }
.page-head {
  display: flex; flex-direction: column; gap: var(--space-3);
  align-items: center; text-align: center; margin-bottom: var(--space-8);
}
.page-head .section-title { font-size: 40px; }
.page-head .section-lede { max-width: 60ch; }
.panel {
  background: var(--color-neutral-100); border-radius: var(--radius-lg);
  padding: var(--space-6);
}
/* Any two stacked blocks get the same seam. `.panel + .panel` alone missed the
   panel that follows a `.split` row (its previous sibling is the split, not a
   panel), so Review history sat flush against Registration details. */
.panel + .panel,
.split + .panel,
.panel + .split,
.split + .split { margin-top: var(--space-6); }
.panel-title { font-family: var(--font-heading); font-size: 22px; margin: 0 0 var(--space-4); }
.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--space-6); align-items: start; }

/* Key/value detail rows (re-upload + confirmation) */
.kv { display: flex; flex-direction: column; gap: 0; margin: 0; }
.kv-row {
  display: grid; grid-template-columns: 210px 1fr; gap: var(--space-3);
  padding: 11px 0; border-bottom: 1px solid var(--color-neutral-300);
}
.kv-row:last-child { border-bottom: 0; }
.kv-key { font-size: 13px; color: var(--color-neutral-700); }
.kv-val { font-weight: 600; word-break: break-word; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; padding: 7px 16px; border-radius: 999px;
  background: var(--color-neutral-200); color: var(--color-neutral-800);
}
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--color-neutral-500); }
.pill.approved { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.pill.approved::before { background: var(--color-accent-2); }
.pill.pending { background: var(--color-accent-100); color: var(--color-accent-800); }
.pill.pending::before { background: var(--color-accent); }
.pill.rejected { background: var(--color-accent-200); color: var(--color-accent-800); }
.pill.rejected::before { background: var(--color-accent-700); }

.entry-shot { border-radius: 18px; overflow: hidden; background: var(--color-neutral-200); }
.entry-shot img { width: 100%; height: auto; display: block; }

/* Status history table */
.table-scroll { overflow-x: auto; }
.statustable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.statustable th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-neutral-600); padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-neutral-300); white-space: nowrap;
}
.statustable td {
  padding: var(--space-3); vertical-align: middle;
  border-bottom: 1px solid var(--color-neutral-200);
}
.statustable tr:last-child td { border-bottom: 0; }
.photoimg {
  width: 62px; height: 62px; border-radius: 12px;
  background-size: cover; background-position: center;
  background-color: var(--color-neutral-300);
}

/* Standalone OTP panel (re-upload verification) */
.otp-panel {
  max-width: 460px; margin: 0 auto;
  background: var(--color-surface); border-radius: calc(var(--radius-lg) * 1.15);
  box-shadow: var(--shadow-md); padding: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-4); align-items: center; text-align: center;
}
.otp-panel h1 { font-size: 30px; margin: 0; }
.otp-panel .otp-row { margin-block: var(--space-2); }
.otp-panel .btn { width: 100%; }

/* Attempt / guidance notes */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--color-accent-100); border-radius: var(--radius-lg);
  padding: 14px 16px; font-size: 14px; line-height: 1.55; color: var(--color-neutral-800);
}
.note.sage { background: var(--color-accent-2-100); }
.note .icon {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--color-accent-200);
  display: flex; align-items: center; justify-content: center;
}
.note.sage .icon { background: var(--color-accent-2-200); }
.note ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* Success / failure result pages */
.result-card {
  max-width: 760px; margin: 0 auto;
  background: var(--color-surface); border-radius: calc(var(--radius-lg) * 1.15);
  box-shadow: var(--shadow-md); padding: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.result-mark {
  width: 72px; height: 72px; border-radius: 50%; align-self: center;
  display: grid; place-items: center;
  background: var(--color-accent-2-200); color: var(--color-accent-2-800);
}
.result-mark.bad { background: var(--color-accent-200); color: var(--color-accent-800); }
.result-title { font-family: var(--font-heading); font-size: 32px; text-align: center; margin: 0; }
.result-card p { margin: 0; line-height: 1.65; color: var(--color-neutral-800); }
.result-card .lead { font-size: 17px; font-weight: 600; color: var(--color-text); }
.dates-inline { display: flex; flex-direction: column; gap: 6px; }
.dates-inline b { color: var(--color-text); }
.share-cta {
  display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start;
  background: var(--color-neutral-100); border-radius: var(--radius-lg); padding: var(--space-4);
}

/* Single-entry vote card (vote.php) */
.solo-entry { max-width: 420px; margin: 0 auto; }
.solo-entry .entry-photo { aspect-ratio: 3 / 4; }

/* Slim page loader (form-submit / payment gateway hand-off).
   Only .pg-shell is centred. The body must stay a normal block: these pages
   also emit the gateway's checkout container and, when something goes wrong,
   PHP's own error markup — as flex children those get stacked out as isolated
   centred lines instead of reading as text. */
.pg-body {
  margin: 0; min-height: 100vh;
  padding: 0 var(--space-4) var(--space-8);
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); overflow-wrap: break-word;
}
.pg-shell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-4); text-align: center;
  padding: calc(var(--space-8) * 1.6) 0 var(--space-6);
}
.pg-body .loading { margin: 0; }
/* loading.gif is an 800x600, 67-frame GIF with an OPAQUE WHITE background, so
   on this warm page it reads as a white card sitting behind the spinner.
   `multiply` blends that white into the cream (white x anything = anything)
   while leaving the coloured dots intact — and unlike re-encoding the GIF with
   a transparent palette index, it keeps every animation frame. */
.pg-body .lodingGif { width: 128px; height: auto; mix-blend-mode: multiply; }
.pg-body .pg-title { font-family: var(--font-heading); font-size: 24px; margin: 0; }
/* Shown only when display_errors is on, so a gateway failure is diagnosable
   instead of a silent bounce back to the home page. */
.pg-alert {
  max-width: 720px; margin: 0 auto;
  background: var(--color-accent-100); color: var(--color-accent-900);
  border-radius: var(--radius-lg); padding: var(--space-4) calc(var(--space-4) * 1.25);
  font-size: 14px; line-height: 1.6;
}

@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-band, .page-band.wide { padding-inline: var(--space-4); }
  .page-head .section-title { font-size: 30px; }
  .kv-row { grid-template-columns: 1fr; gap: 2px; padding: 9px 0; }
  .panel { padding: var(--space-4); }
  .otp-panel, .result-card { padding: var(--space-6); }
  .pg-body .lodingGif { width: 104px; }
  .pg-body .pg-title { font-size: 20px; }
  .cd-cell { width: 76px; height: 76px; }
  .cd-cell .n { font-size: 24px; }
  .entries-stat { padding: 10px 18px; }
  .loadmore-row .btn { width: 100%; justify-content: center; }
}
