/* ============================================================
   CdV Helpdesk — Stylesheet
   Design: minimal, elegante, mobile-first
   ============================================================ */

/* --- Reset & base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --wine:       #7b1e2e;
  --wine-dark:  #5a1520;
  --wine-light: #f9f0f2;
  --gold:       #c9a84c;
  --gray-50:    #f8f9fa;
  --gray-100:   #f0f0f0;
  --gray-300:   #d0d0d0;
  --gray-600:   #6c6c6c;
  --gray-800:   #2c2c2c;
  --green:      #1a7a4a;
  --green-bg:   #eaf7f0;
  --yellow:     #7a5c00;
  --yellow-bg:  #fff9e6;
  --text:       #1e1e1e;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.08);
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout ------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* --- Header ------------------------------------------------- */
.header {
  background: var(--wine);
  color: #fff;
  padding: 0.9rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  margin-left: auto;
  height: 34px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  display: block;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
}

.brand-sub {
  font-size: 0.8rem;
  opacity: 0.75;
  border-left: 1px solid rgba(255,255,255,0.35);
  padding-left: 0.75rem;
}

/* --- Main --------------------------------------------------- */
.main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
}

/* --- Card --------------------------------------------------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 560px;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--wine-dark);
  margin-bottom: 0.4rem;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

/* --- Form --------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1.1rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }

.label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: 0.01em;
}

.input {
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.97rem;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  color: var(--text);
  background: #fff;
}

.input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(123,30,46,0.12);
}

.input::placeholder { color: var(--gray-300); }

.btn-primary {
  background: var(--wine);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.97rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 0.25rem;
}

.btn-primary:hover:not(:disabled) { background: var(--wine-dark); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg {
  color: #c0392b;
  font-size: 0.88rem;
  background: #fdf0ef;
  border: 1px solid #f5c6c2;
  border-radius: 7px;
  padding: 0.6rem 0.85rem;
  margin-top: 0.25rem;
}

/* --- Loading dots ------------------------------------------ */
.loading-dots span {
  animation: blink 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* --- Result ------------------------------------------------- */
.result { display: flex; flex-direction: column; gap: 1.25rem; }

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-badge {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--wine-dark);
  background: var(--wine-light);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.btn-link {
  background: none;
  border: none;
  color: var(--wine);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* --- Scenario pills ---------------------------------------- */
.scenario-pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.pill-green  { background: var(--green-bg);  color: var(--green); }
.pill-yellow { background: var(--yellow-bg); color: var(--yellow); }
.pill-gray   { background: var(--gray-100);  color: var(--gray-600); }

.scenario-desc {
  font-size: 0.93rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* --- Tracking ---------------------------------------------- */
.tracking-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }

.tracking-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 9px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tracking-company {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gray-800);
}

.tracking-number {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-family: monospace;
}

.btn-track {
  display: inline-block;
  margin-top: 0.35rem;
  background: var(--wine);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  width: fit-content;
  transition: background 0.15s;
}
.btn-track:hover { background: var(--wine-dark); text-decoration: none; }

/* --- Section divider --------------------------------------- */
.section-divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 1.25rem 0;
}

/* --- Products ---------------------------------------------- */
.product-section { margin-top: 0; }

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.product-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.product-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--gray-100);
  gap: 0.5rem;
}

.product-item:last-child { border-bottom: none; }

.product-title {
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
}

.product-qty {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

/* --- Footer ------------------------------------------------- */
.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.82rem;
  color: var(--gray-600);
  border-top: 1px solid var(--gray-100);
}

.footer a { color: var(--wine); }

/* --- Responsive -------------------------------------------- */
@media (max-width: 480px) {
  .card { padding: 1.5rem 1.25rem; }
  .card-title { font-size: 1.2rem; }
}
