/* =========================================================================
   LINKORAE V2 - Mobile-first mini-program shell
   Hidden on PC (≥769px). PC layout untouched.
   ========================================================================= */

:root {
  --lk-navy: #0A1628;
  --lk-navy-2: #122038;
  --lk-accent: #E85F00;
  --lk-accent-2: #CF5708;
  --lk-gold: #F5B544;
  --lk-green: #1A7F5A;
  --lk-bg: #F5F7FA;
  --lk-card: #FFFFFF;
  --lk-border: #E5EAF0;
  --lk-text: #0A1628;
  --lk-muted: #546E7A;
  --lk-radius: 16px;
  --lk-shadow: 0 4px 20px rgba(10,22,40,0.08);
  --lk-shadow-hover: 0 8px 32px rgba(10,22,40,0.14);
  --lk-gradient: linear-gradient(135deg, #0A1628 0%, #122038 100%);
  --lk-accent-gradient: linear-gradient(135deg, #E85F00 0%, #F5B544 100%);
}

/* Global reset for v2 pages */
.lk-v2-page {
  margin: 0;
  padding: 0;
  background: var(--lk-bg);
  color: var(--lk-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.lk-v2-page * { box-sizing: border-box; }

/* ================== TOP BAR ================== */
.lk-topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--lk-gradient);
  color: #fff;
  padding: 16px 20px;
  padding-top: calc(16px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.lk-topbar-back {
  background: rgba(255,255,255,0.12);
  border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
}
.lk-topbar-title {
  flex: 1; font-size: 17px; font-weight: 700;
}
.lk-topbar-sub {
  font-size: 12px; opacity: 0.75; margin-top: 2px;
}

/* ================== HERO BLOCK ================== */
.lk-hero {
  background: var(--lk-gradient);
  color: #fff;
  padding: 28px 20px 32px;
  text-align: center;
  position: relative; overflow: hidden;
}
.lk-hero::before {
  content: ""; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(232,101,10,0.25), transparent 70%);
  border-radius: 50%;
}
.lk-hero h1 {
  font-size: 26px; font-weight: 800; margin: 0 0 10px;
  letter-spacing: -0.01em; line-height: 1.25;
}
.lk-hero p {
  font-size: 14.5px; opacity: 0.92; margin: 0;
  line-height: 1.55; max-width: 340px; margin: 0 auto;
}
.lk-hero-emoji {
  font-size: 36px; margin-bottom: 10px; display: block;
}

/* ================== CARDS & FORM ================== */
.lk-container {
  padding: 20px;
  max-width: 540px;
  margin: 0 auto;
}

.lk-card {
  background: var(--lk-card);
  border-radius: var(--lk-radius);
  padding: 20px;
  box-shadow: var(--lk-shadow);
  margin-bottom: 16px;
}

.lk-card-title {
  font-size: 16px; font-weight: 700; color: var(--lk-navy);
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.lk-card-sub {
  font-size: 13px; color: var(--lk-muted); margin-bottom: 16px; line-height: 1.6;
}

.lk-field {
  margin-bottom: 14px;
}
.lk-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--lk-navy); margin-bottom: 6px;
}
.lk-label .lk-required { color: var(--lk-accent); margin-left: 2px; }

.lk-input, .lk-select, .lk-textarea {
  width: 100%;
  border: 1.5px solid var(--lk-border);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 15px;
  color: var(--lk-navy);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.lk-input:focus, .lk-select:focus, .lk-textarea:focus {
  outline: none;
  border-color: var(--lk-accent);
  box-shadow: 0 0 0 3px rgba(232,101,10,0.12);
}
.lk-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='%23546E7A' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.lk-helper {
  display: block;
  font-size: 12px;
  color: var(--lk-muted);
  margin-top: 6px;
  line-height: 1.5;
  font-style: italic;
  padding-left: 2px;
}
.lk-helper::before { content: "💡 "; font-style: normal; margin-right: 2px; }

/* Row with 2 columns */
.lk-row2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.lk-row3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}

/* Cargo type picker (pill buttons) */
.lk-picker {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 16px;
}
.lk-pick-opt {
  padding: 14px 10px;
  border: 2px solid var(--lk-border);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
}
.lk-pick-opt .lk-pick-icon {
  font-size: 28px; display: block; margin-bottom: 6px;
}
.lk-pick-opt .lk-pick-label {
  font-size: 14px; font-weight: 700; color: var(--lk-navy);
}
.lk-pick-opt .lk-pick-desc {
  font-size: 11px; color: var(--lk-muted); margin-top: 2px;
}
.lk-pick-opt.active {
  border-color: var(--lk-accent);
  background: linear-gradient(135deg, #FFF7ED 0%, #FFE4C5 100%);
  box-shadow: 0 4px 14px rgba(232,101,10,0.18);
}
.lk-pick-opt.active .lk-pick-label { color: var(--lk-accent-2); }

/* Submit button */
.lk-btn {
  width: 100%;
  background: var(--lk-accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(232,101,10,0.3);
  transition: all 0.2s;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.lk-btn:hover { background: var(--lk-accent-2); transform: translateY(-1px); }
.lk-btn:active { transform: translateY(0); }
.lk-btn:disabled { background: #B5BFCC; cursor: not-allowed; box-shadow: none; transform: none; }

.lk-btn-secondary {
  background: #fff; color: var(--lk-navy); border: 1.5px solid var(--lk-border);
  box-shadow: none;
}
.lk-btn-secondary:hover { background: #F5F7FA; border-color: var(--lk-accent); color: var(--lk-accent); }

/* Result card */
.lk-quote-result {
  background: var(--lk-gradient);
  color: #fff;
  border-radius: var(--lk-radius);
  padding: 26px 22px;
  text-align: center;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.lk-quote-result::after {
  content: ""; position: absolute; bottom: -40px; left: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(245,181,68,0.25), transparent);
  border-radius: 50%;
}
.lk-quote-result h2 {
  font-size: 22px; font-weight: 800; margin: 0 0 8px; position: relative; z-index: 1;
}
.lk-quote-result .lk-quote-sub {
  font-size: 13.5px; opacity: 0.88; margin-bottom: 20px; position: relative; z-index: 1;
}
.lk-quote-amount {
  font-size: 48px; font-weight: 800;
  background: var(--lk-accent-gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.1;
  position: relative; z-index: 1;
}
.lk-quote-currency { font-size: 32px; margin-right: 6px; opacity: 1; font-weight: 700; }
.lk-quote-unit { font-size: 16px; opacity: 0.7; margin-left: 6px; }
.lk-quote-zone {
  font-size: 13px; opacity: 0.85; margin-top: 10px;
  background: rgba(255,255,255,0.1);
  padding: 7px 14px; border-radius: 20px;
  display: inline-block;
  position: relative; z-index: 1;
}

/* Quote breakdown rows */
.lk-breakdown { margin-top: 18px; }
.lk-bd-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--lk-border);
  font-size: 13.5px;
}
.lk-bd-row:last-child { border-bottom: none; }
.lk-bd-label { color: var(--lk-muted); }
.lk-bd-value { color: var(--lk-navy); font-weight: 600; }
.lk-bd-total {
  padding-top: 12px; margin-top: 6px;
  border-top: 2px dashed var(--lk-border);
  font-size: 16px;
}
.lk-bd-total .lk-bd-value { color: var(--lk-accent); font-weight: 800; font-size: 18px; }

/* Human touch banner */
.lk-humn {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFE4C5 100%);
  border-left: 4px solid var(--lk-accent);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 13.5px;
  color: #5a4a30;
  line-height: 1.7;
  margin-bottom: 16px;
}
.lk-humn strong { color: var(--lk-accent-2); }
.lk-humn-title {
  font-weight: 700; color: var(--lk-navy);
  margin-bottom: 6px; font-size: 14px;
}

/* Step indicator */
.lk-stepper {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 24px;
  padding: 0 8px;
}
.lk-step {
  display: flex; flex-direction: column; align-items: center; flex: 1;
  position: relative;
}
.lk-step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2px solid var(--lk-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--lk-muted);
  z-index: 1; transition: all 0.3s;
}
.lk-step-label {
  font-size: 11px; color: var(--lk-muted); margin-top: 6px;
  font-weight: 600; text-align: center;
}
.lk-step.active .lk-step-dot {
  background: var(--lk-accent); border-color: var(--lk-accent); color: #fff;
  box-shadow: 0 0 0 5px rgba(232,101,10,0.15);
}
.lk-step.active .lk-step-label { color: var(--lk-accent); }
.lk-step.done .lk-step-dot {
  background: var(--lk-green); border-color: var(--lk-green); color: #fff;
}
.lk-step.done .lk-step-label { color: var(--lk-green); }
.lk-step:not(:last-child)::after {
  content: ""; position: absolute; top: 16px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 2px; background: var(--lk-border); z-index: 0;
}
.lk-step.done:not(:last-child)::after { background: var(--lk-green); }

/* Warehouse address card */
.lk-address {
  background: #F5F7FA; border-radius: 12px; padding: 16px;
  font-family: monospace; font-size: 13.5px; color: var(--lk-navy);
  line-height: 1.7; word-break: break-word;
  border: 1px dashed var(--lk-border);
  margin-bottom: 12px;
}
.lk-copy-btn {
  background: var(--lk-navy); color: #fff; border: none;
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  cursor: pointer; font-weight: 600;
}
.lk-copy-btn:hover { background: var(--lk-navy-2); }
.lk-copy-btn.copied { background: var(--lk-green); }

/* Upload zone */
.lk-upload {
  border: 2px dashed var(--lk-border);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: #FAFBFC;
  transition: all 0.2s;
}
.lk-upload:hover { border-color: var(--lk-accent); background: #FFF7ED; }
.lk-upload input[type="file"] { display: none; }
.lk-upload-icon { font-size: 36px; margin-bottom: 8px; }
.lk-upload-title { font-size: 14px; font-weight: 700; color: var(--lk-navy); }
.lk-upload-sub { font-size: 12px; color: var(--lk-muted); margin-top: 4px; }
.lk-upload.has-file { border-style: solid; border-color: var(--lk-green); background: #E8F5EE; }

/* Error / alert */
.lk-alert {
  padding: 12px 14px; border-radius: 10px;
  font-size: 13.5px; margin-bottom: 14px;
  line-height: 1.55;
}
.lk-alert-error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.lk-alert-info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.lk-alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }

/* Loading spinner */
.lk-spin {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lk-spin 0.8s linear infinite;
}
@keyframes lk-spin { to { transform: rotate(360deg); } }

/* Celebration/Success */
.lk-celebrate {
  font-size: 64px; text-align: center; margin: 20px 0;
  animation: lk-bounce 1s ease-in-out;
}
@keyframes lk-bounce {
  0%, 100% { transform: translateY(0); }
  25%      { transform: translateY(-20px); }
  50%      { transform: translateY(0); }
  75%      { transform: translateY(-8px); }
}

/* Desktop presentation — keep the "app card" feel but stay fully scrollable */
@media (min-width: 900px) {
  html, body { height: auto; overflow: auto; }
  .lk-v2-page {
    max-width: 640px;
    margin: 24px auto;
    box-shadow: 0 20px 60px rgba(10,22,40,0.15);
    border-radius: 20px;
    /* overflow: visible + min-height: 100vh keeps the page scrollable on desktop */
    overflow: visible;
    min-height: 100vh;
  }
  /* Ensure nothing in the v2 layout accidentally traps scroll on desktop */
  .lk-v2-page .lk-container,
  .lk-v2-page .lk-hero,
  .lk-v2-page .lk-topbar { overflow: visible; }
}