/* ════════════════════════════════════════════════════════
   IPONE Campaign Microsite — style.css
   Aesthetic: Industrial / Motorsport / Manga-punk
   ════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,600;0,700;0,900;1,700&family=Barlow:wght@400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --red:        #e63030;
  --red-dark:   #b71c1c;
  --red-glow:   rgba(230,48,48,0.25);
  --black:      #0a0a0a;
  --dark:       #111111;
  --card-bg:    rgba(15,15,15,0.92);
  --border:     rgba(255,255,255,0.08);
  --border-red: rgba(230,48,48,0.35);
  --text:       #f0f0f0;
  --text-muted: #888;
  --white:      #ffffff;
  --gold:       #d4a017;
  --shadow:     0 20px 60px rgba(0,0,0,0.8);
  --radius:     14px;
  --font-head:  'Barlow Condensed', sans-serif;
  --font-body:  'Barlow', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Desktop Warning ───────────────────────────────────── */
#desktopWarning {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  padding: 40px;
}

#desktopWarning .dw-icon {
  font-size: 64px;
  animation: pulse 2s infinite;
}

#desktopWarning h2 {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--white);
  text-transform: uppercase;
}

#desktopWarning p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 320px;
  line-height: 1.6;
}

#desktopWarning .dw-logo {
  width: 120px;
  object-fit: contain;
  margin-bottom: 10px;
}

/* ── App Wrapper ───────────────────────────────────────── */
#app {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

/* ── Background ────────────────────────────────────────── */
.bg-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--black);
  overflow: hidden;
}

.bg-wrap img {
  width: 100%;
  height: 100%;
  object-fit: fill; /* Ensures the FULL image is visible on any mobile screen aspect ratio */
  object-position: left bottom;
  opacity: 1; /* Removed darkness/opacity from the image itself */
}

.bg-overlay {
  display: none; /* Removed the dark gradient overlay to make background clearly visible */
}

/* ── Screens ───────────────────────────────────────────── */
.screen-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 0 40px;
  animation: fadeUp 0.35s ease both;
}

.screen.active {
  display: flex;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 16px;
}

.site-logo {
  height: 44px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ── Hero Banner ───────────────────────────────────────── */
.hero-banner {
  height: 200px;
  display: flex;
  align-items: flex-end;
  padding: 0 24px 24px;
  background: transparent;
}

.hero-tagline {
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

.hero-tagline span {
  color: var(--red);
  font-style: italic;
}

/* ── Content Card ──────────────────────────────────────── */
.content-card {
  margin: 0 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 28px 22px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.04);
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.1;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  letter-spacing: 0.03em;
}

.red-line {
  width: 36px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
  margin-bottom: 22px;
}

/* ── Form Fields ───────────────────────────────────────── */
.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field-input,
.field-select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px 16px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.field-input::placeholder { color: rgba(255,255,255,0.25); }

.field-input:focus,
.field-select:focus {
  border-color: var(--red);
  background: rgba(230,48,48,0.06);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.field-input.field-error,
.field-select.field-error {
  border-color: #e63030;
  background: rgba(230,48,48,0.08);
}

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.field-select option {
  background: #1a1a1a;
  color: var(--white);
}

.field-error-msg {
  display: none;
  font-size: 0.75rem;
  color: #e63030;
  margin-top: 5px;
  padding-left: 4px;
}

/* Mobile number row */
.mobile-row {
  display: flex;
  gap: 10px;
}

.mobile-prefix {
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.mobile-row .field-input { flex: 1; }

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border: none;
  border-radius: 10px;
  padding: 15px 24px;
  color: var(--white);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 22px rgba(230,48,48,0.35);
  margin-top: 6px;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(230,48,48,0.55);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.btn-loading .btn-text::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

/* ── OTP Section ───────────────────────────────────────── */
.otp-display-mobile {
  text-align: center;
  margin-bottom: 22px;
  padding: 12px 16px;
  background: rgba(230,48,48,0.08);
  border: 1px solid var(--border-red);
  border-radius: 10px;
}

.otp-display-mobile .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.otp-display-mobile .number {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
}

.otp-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

#lnkResendOtp {
  display: none;
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: var(--font-body);
}

#otpTimerText {
  font-size: 0.80rem;
  color: var(--text-muted);
}

#otpCountdown {
  color: var(--red);
  font-weight: 700;
}

/* ── Camera Capture — Upload Screen ───────────────────── */

/* Capture CTA button */
.btn-capture {
  width: 100%;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border: none;
  border-radius: 14px;
  padding: 20px 20px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 8px 28px rgba(230,48,48,0.4);
  position: relative;
  overflow: hidden;
}

.btn-capture::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, transparent 55%);
  pointer-events: none;
}

.btn-capture:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(230,48,48,0.55);
}

.btn-capture:active:not(:disabled) {
  transform: translateY(0);
  opacity: 0.92;
}

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

.btn-capture-icon {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.btn-capture-label {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
}

.btn-capture-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.04em;
}

/* Fallback gallery link row */
.capture-fallback-note {
  text-align: center;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.lnk-gallery {
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: 2px;
}

.lnk-gallery:hover { color: #ff5050; }

/* Preview area */
.preview-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #16a34a;
  box-shadow: 0 6px 24px rgba(22,163,74,0.25);
  margin-bottom: 16px;
}

#imgPreview {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
}

.preview-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(22,163,74,0.88);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 30px;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Preview action buttons row */
.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 4px;
}

/* Secondary (Retake) button */
.btn-secondary {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

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

/* Upload Photo button — reuses btn-primary but fits grid */
.btn-upload-photo {
  width: 100%;
  margin-top: 0;
}

/* ── Thank You Screen ──────────────────────────────────── */
.thankyou-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

/* Solid card so content is always readable over the background image */
.ty-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 36px 24px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.ty-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 30px rgba(22,163,74,0.4);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.ty-title {
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.05;
}

.ty-title span { color: var(--red); }

.ty-divider {
  width: 36px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}

.ty-msg {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 280px;
}

.ty-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(230,48,48,0.12);
  border: 1px solid var(--border-red);
  border-radius: 50px;
  padding: 9px 20px;
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: 4px;
}

/* ── Loader Overlay ────────────────────────────────────── */
#loaderOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(4px);
}

.loader-ring {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-text {
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.08); } }

/* ── Steps Indicator ───────────────────────────────────── */
.steps-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px 0;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 0.3s, transform 0.3s;
}

.step-dot.active {
  background: var(--red);
  transform: scale(1.25);
}

.step-dot.done {
  background: #16a34a;
}

/* ── Info Box ──────────────────────────────────────────── */
.info-box {
  background: rgba(212,160,23,0.08);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.80rem;
  color: var(--gold);
  line-height: 1.6;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.info-box-icon { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

/* ── Divider ───────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Back link ─────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.80rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--white); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--red-dark); border-radius: 4px; }
