/* ============================================
   Dhofar Poultry – QR Collect Public Page
   Brand: #F2CEA2 (cream) | #2168A6 (blue) | #D93030 (red)
   ============================================ */

:root {
  --dp-cream:       #F2CEA2;
  --dp-cream-light: #FBF0E0;
  --dp-cream-dark:  #E8B87A;
  --dp-blue:        #2168A6;
  --dp-blue-dark:   #174F82;
  --dp-blue-darker: #0E3060;
  --dp-red:         #D93030;
  --dp-border:      #E8D5B5;
  --dp-text:        #1A2740;
}

/* ─── Animations ────────────────────────────── */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}
@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(24px, -36px) scale(1.04); }
  66%       { transform: translate(-18px, -16px) scale(0.97); }
}
@keyframes float-logo {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-10px) scale(1.02); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin-rev {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer-btn {
  0%   { transform: translateX(-200%); }
  100% { transform: translateX(300%); }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: .5; }
  50%       { transform: scale(1.8); opacity: 0; }
}
@keyframes glow-success {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  50%       { box-shadow: 0 0 0 14px rgba(16,185,129,0); }
}

/* ─── Page Layout ───────────────────────────── */
.collect-page {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 32px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* ─── Background ────────────────────────────── */
.collect-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(160deg, #0A2545 0%, #174F82 35%, #2168A6 68%, #174F82 100%);
  background-size: 300% 300%;
  animation: gradient-shift 16s ease infinite;
}

/* Geometric line pattern overlay */
.collect-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .045;
  background-image:
    repeating-linear-gradient(60deg,  rgba(242,206,162,.8) 0, rgba(242,206,162,.8) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(-60deg, rgba(242,206,162,.8) 0, rgba(242,206,162,.8) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(0deg,   rgba(242,206,162,.4) 0, rgba(242,206,162,.4) 1px, transparent 1px, transparent 32px);
}

/* ─── Animated Orbs ─────────────────────────── */
.collect-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.collect-orb-1 {
  width: 550px; height: 550px;
  background: radial-gradient(circle, rgba(242,206,162,.16) 0%, transparent 68%);
  top: -200px; right: -200px;
  animation: float-orb 14s ease-in-out infinite;
}
.collect-orb-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(217,48,48,.1) 0%, transparent 68%);
  bottom: -160px; left: -160px;
  animation: float-orb 18s ease-in-out infinite reverse;
}
.collect-orb-3 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(242,206,162,.1) 0%, transparent 68%);
  top: 40%; right: 5%;
  animation: float-orb 22s ease-in-out 4s infinite;
}

/* ─── Spinning Rings ────────────────────────── */
.collect-ring {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.collect-ring-1 {
  width: 700px; height: 700px;
  border: 1px solid rgba(242,206,162,.1);
  top: 50%; left: 50%;
  margin: -350px 0 0 -350px;
  animation: spin-slow 70s linear infinite;
}
.collect-ring-1::before, .collect-ring-1::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  background: var(--dp-cream);
  border-radius: 50%;
  opacity: .45;
}
.collect-ring-1::before { top: 0; left: 50%; margin-left: -5px; }
.collect-ring-1::after  { bottom: 0; left: 50%; margin-left: -5px; }

.collect-ring-2 {
  width: 480px; height: 480px;
  border: 1px solid rgba(217,48,48,.12);
  top: 50%; left: 50%;
  margin: -240px 0 0 -240px;
  animation: spin-rev 50s linear infinite;
}
.collect-ring-2::before {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  background: var(--dp-red);
  border-radius: 50%;
  right: 0; top: 50%;
  margin-top: -4px;
  opacity: .5;
}

.collect-ring-3 {
  width: 280px; height: 280px;
  border: 1px solid rgba(242,206,162,.18);
  top: 50%; left: 50%;
  margin: -140px 0 0 -140px;
  animation: spin-slow 35s linear infinite;
}

/* ─── Wrapper ───────────────────────────────── */
.collect-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  animation: fade-in-up .65s ease forwards;
}

/* ─── Logo Area ─────────────────────────────── */
.collect-logo-area {
  text-align: center;
  margin-bottom: 8px;
}
.collect-logo {
  height: 110px;
  width: auto;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,.45));
  animation: float-logo 8s ease-in-out infinite;
}

.collect-banner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 16px;
  border-radius: clamp(10px, 2.5vw, 14px);
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  animation: fade-in-up .6s ease both;
  background: rgba(255, 255, 255, .08);
  box-sizing: border-box;
}
.collect-banner a {
  display: block;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.collect-banner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: clamp(110px, 34vw, 220px);
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
}

@media (min-width: 481px) {
  .collect-banner-img {
    max-height: clamp(130px, 24vw, 250px);
  }
}

@media (min-width: 768px) {
  .collect-banner {
    margin-bottom: 20px;
  }
  .collect-banner-img {
    max-height: 280px;
  }
}

@media (max-width: 480px) {
  .collect-banner {
    margin-bottom: 12px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  }
  .collect-banner-img {
    max-height: clamp(88px, 30vw, 150px);
  }
}

/* 30‑years badge under logo */
.collect-badge-area {
  text-align: center;
  margin-bottom: 20px;
}
.collect-badge {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.3));
  animation: float-logo 10s ease-in-out 2s infinite;
}

/* ─── Card ──────────────────────────────────── */
.collect-card {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(24px);
  border-radius: 28px;
  box-shadow:
    0 36px 72px rgba(14,48,96,.45),
    0 0 0 1px rgba(255,255,255,.45) inset;
  padding: 44px 36px 32px;
  position: relative;
  overflow: hidden;
}

/* Tri-color top stripe */
.collect-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--dp-blue) 0%, var(--dp-cream) 50%, var(--dp-red) 100%);
}

/* ─── Language Switcher ─────────────────────── */
.collect-lang-switcher {
  position: absolute;
  top: 16px; right: 16px; left: 16px;
  text-align: right;
  font-size: .88rem;
  z-index: 2;
}
html[dir="rtl"] .collect-lang-switcher { text-align: left; }

.collect-lang-link {
  color: var(--dp-blue-dark);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
  transition: background .2s, color .2s;
}
.collect-lang-link:hover { background: var(--dp-cream-light); color: var(--dp-blue); }
.collect-lang-link.active { color: var(--dp-blue); font-weight: 800; background: var(--dp-cream-light); }
.collect-lang-sep { color: #cbd5e1; margin: 0 4px; }

/* ─── Form Header ───────────────────────────── */
.collect-header {
  margin-bottom: 26px;
  text-align: center;
}
.collect-title {
  margin: 0 0 7px;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--dp-blue-darker);
  letter-spacing: -0.02em;
}
.collect-subtitle {
  margin: 0;
  font-size: .9rem;
  color: #64748b;
  font-weight: 400;
}

/* ─── Error ─────────────────────────────────── */
.collect-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 13px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid #fecaca;
}

/* ─── Form ──────────────────────────────────── */
.collect-form { display: flex; flex-direction: column; gap: 18px; }
.collect-field { display: flex; flex-direction: column; gap: 7px; }

.collect-label {
  font-size: .87rem;
  font-weight: 700;
  color: var(--dp-blue-dark);
  letter-spacing: .02em;
}

.collect-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  color: #1e293b;
  background: #f7f9fc;
  border: 2px solid #e3eaf3;
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.collect-input::placeholder { color: #94a3b8; }
.collect-input:hover  { border-color: var(--dp-cream-dark); }
.collect-input:focus {
  outline: none;
  border-color: var(--dp-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(33,104,166,.12);
}

/* ─── Location Block ────────────────────────── */
.collect-location {
  padding: 14px 16px;
  background: var(--dp-cream-light);
  border-radius: 14px;
  border: 1px solid var(--dp-border);
}
.collect-location-hint {
  margin: 0 0 8px;
  font-size: .85rem;
  color: var(--dp-blue-dark);
  font-weight: 700;
}
.collect-location-retry {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 15px;
  font-size: .88rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--dp-blue);
  background: transparent;
  border: 2px solid var(--dp-blue);
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.collect-location-retry:hover { background: var(--dp-blue); color: #fff; }
.collect-location-status {
  display: block;
  margin-top: 8px;
  font-size: .84rem;
  min-height: 1.2em;
  color: #64748b;
}
.collect-location-status.location-ok  { color: #059669; font-weight: 700; }
.collect-location-status.location-skip { color: #94a3b8; }

/* ─── Submit Button ─────────────────────────── */
.collect-submit {
  width: 100%;
  margin-top: 8px;
  padding: 16px 24px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--dp-blue) 0%, var(--dp-blue-dark) 100%);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(33,104,166,.42);
  transition: transform .15s, box-shadow .2s;
  letter-spacing: .03em;
  position: relative;
  overflow: hidden;
}
.collect-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  animation: shimmer-btn 3.5s ease-in-out infinite;
}
.collect-submit:hover  { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(33,104,166,.52); }
.collect-submit:active { transform: translateY(0); }
.collect-submit:focus  { outline: none; box-shadow: 0 0 0 4px rgba(33,104,166,.3); }

/* ─── Certifications ────────────────────────── */
.collect-certs {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #ede8e0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.collect-cert-img {
  display: block;
  height: 130px;
  width: auto;
  opacity: .7;
  transition: opacity .2s, transform .2s;
}
.collect-cert-img:hover { opacity: 1; transform: scale(1.06); }

/* ─── Success State ─────────────────────────── */
.collect-success { text-align: center; padding: 20px 0 8px; }
.collect-success-icon {
  width: 80px; height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  animation: glow-success 2.4s ease infinite;
}
.collect-success-title {
  margin: 0 0 12px;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--dp-blue-darker);
}
.collect-success-text {
  margin: 0;
  font-size: .95rem;
  color: #64748b;
  line-height: 1.7;
}

/* ─── Radio & Instagram link ─────────────────── */
.collect-field-radio { gap: 10px; }
.collect-radio-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
}
.collect-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--dp-blue-dark);
}
.collect-radio-label input { width: auto; accent-color: var(--dp-blue); }
.collect-instagram-link {
  margin: 8px 0 0;
  font-size: .88rem;
}
.collect-instagram-link a {
  color: var(--dp-blue);
  font-weight: 700;
  text-decoration: none;
}
.collect-instagram-link a:hover { text-decoration: underline; }

/* ─── Invoice camera (no visible file input) ─── */
.collect-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.collect-field-invoice { position: relative; }
.collect-btn-camera {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 24px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--dp-blue-dark);
  background: var(--dp-cream-light);
  border: 2px dashed var(--dp-cream-dark);
  border-radius: 16px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.collect-btn-camera:hover {
  background: var(--dp-cream);
  border-color: var(--dp-blue);
  transform: translateY(-1px);
}
.collect-btn-camera:focus {
  outline: none;
  border-color: var(--dp-blue);
  box-shadow: 0 0 0 4px rgba(33,104,166,.15);
}
.collect-btn-camera-icon { font-size: 1.5rem; }
.collect-invoice-status {
  margin: 10px 0 0;
  font-size: .88rem;
  font-weight: 600;
  color: #059669;
  min-height: 1.3em;
}
.collect-field-hint {
  margin: 6px 0 0;
  font-size: .82rem;
  color: #64748b;
}

/* ─── Rules section ─────────────────────────── */
.collect-rules {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #ede8e0;
  text-align: start;
}
.collect-rules-title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--dp-blue-darker);
}
.collect-rules-intro {
  margin: 0 0 14px;
  font-size: .88rem;
  color: #475569;
  line-height: 1.6;
}
.collect-rules-terms {
  margin: 0 0 8px;
  font-size: .87rem;
  font-weight: 700;
  color: var(--dp-blue-dark);
}
.collect-rules-list {
  margin: 0;
  padding-inline-start: 1.25rem;
  font-size: .84rem;
  color: #475569;
  line-height: 1.7;
}
.collect-rules-list li { margin-bottom: 4px; }
.collect-rules-list a {
  color: var(--dp-blue);
  font-weight: 600;
  text-decoration: none;
}
.collect-rules-list a:hover { text-decoration: underline; }

/* ─── Submitting state (form hidden) ────────── */
#collect-form-wrap { position: relative; min-height: 120px; }
.collect-submitting {
  display: none;
  text-align: center;
  padding: 32px 24px;
}
.collect-submitting[hidden] { display: none !important; }
.collect-submitting:not([hidden]) { display: block; }
.collect-submitting-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--dp-cream);
  border-top-color: var(--dp-blue);
  border-radius: 50%;
  animation: collect-spin 0.9s linear infinite;
}
@keyframes collect-spin {
  to { transform: rotate(360deg); }
}
.collect-submitting-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dp-blue-dark);
}
#collect-form-wrap .collect-form[aria-hidden="true"] {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ─── Mobile ────────────────────────────────── */
@media (max-width: 480px) {
  .collect-page    { padding: 20px 12px 36px; }
  .collect-card    { padding: 36px 20px 24px; border-radius: 22px; }
  .collect-title   { font-size: 1.42rem; }
  .collect-logo    { height: 86px; }
  .collect-badge   { height: 44px; }
  .collect-ring-1, .collect-ring-2, .collect-ring-3 { display: none; }
}
