/* =====================================================================
   Sera Stays PM Portal -- shared styles.
   One cacheable stylesheet for the palette and the components every page
   used to copy inline (header, form fields, photo upload widget, result
   cards, progress bar). Pages link this BEFORE their own <style>, so any
   page-specific rule still wins by source order.
   ===================================================================== */

:root {
  --myrtle: #618577;
  --myrtle-dark: #4f6e62;
  --sunshine: #FFCC40;
  --bg: #faf7f0;
  --card: #ffffff;
  --ink: #2f3d38;
  --muted: #7c8b84;
  --line: #ebe6da;
  --danger: #c0392b;
  --alert: #c0392b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100vw; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Header --------------------------------------------------------- */
header {
  width: 100%;
  background: var(--myrtle);
  padding: 22px 18px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
}
header img.logo { width: 130px; max-width: 50%; height: auto; display: block; }
header .sub { margin-top: 10px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.85); }
header .home-link { margin-top: 14px; font-size: 13px; color: rgba(255,255,255,0.65); text-decoration: none; border: 1px solid rgba(255,255,255,0.3); border-radius: 20px; padding: 5px 14px; }

/* ---- Form fields ----------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--myrtle-dark);
}
.req { color: var(--danger); margin-left: 3px; }

select, textarea, input[type="text"], input[type="number"], input[type="date"], input[type="tel"], input[type="email"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--card);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23618577' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select:focus, textarea:focus, input:focus { outline: none; border-color: var(--myrtle); }
select:disabled { opacity: 0.45; }
textarea { resize: vertical; min-height: 100px; }

/* ---- Photo / media upload widget ------------------------------------- */
.photo-area {
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s;
  position: relative;
}
.photo-area:active { border-color: var(--myrtle); }
.photo-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.photo-area .icon { font-size: 32px; margin-bottom: 8px; }
.photo-area .hint { font-size: 13px; color: var(--muted); }
.photo-area .filename { font-size: 13px; color: var(--myrtle-dark); font-weight: 600; margin-top: 6px; }
.photo-area .preview-img { max-width: 100%; max-height: 220px; border-radius: 10px; object-fit: cover; display: block; margin: 0 auto 8px; }

#upload-progress {
  display: none;
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
#upload-progress .bar { height: 100%; background: var(--myrtle); width: 0%; transition: width 0.3s ease; }

/* ---- Buttons ---------------------------------------------------------- */
button[type="submit"], button.primary {
  width: 100%;
  padding: 17px;
  border-radius: 14px;
  border: none;
  background: var(--myrtle);
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease;
}
button[type="submit"]:active, button.primary:active { background: var(--myrtle-dark); }
button[type="submit"]:disabled, button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Result cards ------------------------------------------------------ */
#result { display: none; width: 100%; max-width: 460px; padding: 0 18px 48px; }
.result-card { border-radius: 20px; padding: 36px 24px; text-align: center; }
.result-card.success { background: var(--card); border: 1px solid var(--line); box-shadow: 0 2px 16px rgba(97,133,119,0.10); color: var(--ink); }
.result-card.error   { background: #fdf0ef; border: 2px solid var(--danger); color: var(--danger); }
.result-card .check-circle {
  width: 72px; height: 72px; border-radius: 50%; background: var(--myrtle);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; font-size: 32px; color: #fff; line-height: 1;
}
.result-card .icon  { font-size: 40px; margin-bottom: 12px; }
.result-card .title { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.result-card .subtitle { font-size: 16px; font-weight: 600; color: var(--myrtle); margin-bottom: 4px; }
.result-card .detail { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.result-card .btn-primary {
  width: 100%; padding: 15px; border-radius: 12px; border: none;
  background: var(--myrtle); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  display: block; margin-bottom: 12px;
}
.result-card .btn-link { font-size: 14px; color: var(--muted); text-decoration: none; display: block; }
.result-card.error button { padding: 12px 28px; border-radius: 10px; border: 2px solid var(--danger); background: transparent; color: var(--danger); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
