/* ═══════════════════════════════════════════════════════
   card-light.css  –  Card.aspx  Light Cream × Gold Theme
   Matches the reference image: white/cream bg, gold ring,
   gold buttons, clean Thai typography
═══════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────── */
:root {
  /* Gold palette */
  --g1:  #C9A040;   /* mid gold – borders, icons  */
  --g2:  #E2C060;   /* light gold – hover, glow   */
  --g3:  #F0D98A;   /* pale gold – backgrounds    */
  --gd:  #8B6510;   /* dark gold – button start   */
  --gb:  #6B4D08;   /* deep gold – btn bottom     */

  /* Neutrals */
  --cream:   #FBF8F0;   /* page bg                */
  --white:   #FFFFFF;
  --card-bg: #FFFFFF;
  --text-h:  #1A1208;   /* headings               */
  --text-b:  #3D2E10;   /* body / contacts        */
  --text-s:  #7A6030;   /* subtitle / position    */
  --text-m:  #B09050;   /* muted                  */
  --border:  rgba(180,140,40,0.25);

  /* Shadows */
  --shadow-card: 0 24px 64px rgba(100,70,0,0.14), 0 4px 16px rgba(100,70,0,0.08);
  --shadow-btn:  0 6px 20px rgba(139,101,16,0.45);
  --shadow-ring: 0 0 0 3px rgba(201,160,64,0.20);

  /* Radii & sizing */
  --r-card: 28px;
  --r-btn:  14px;
  --r-icon: 10px;
  --card-w: 380px;

  /* Typography */
  --font-th:  'Sarabun', sans-serif;
  --font-en:  'Cormorant Garamond', serif;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-th);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button, [type=submit] { font-family: var(--font-th); cursor: pointer; border: none; background: none; }

/* ── Background decorative layer ───────────────────── */
.bg-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: .07;
}

.bg-circle-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--g1) 0%, transparent 70%);
  top: -200px; left: -200px;
}

.bg-circle-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--g2) 0%, transparent 70%);
  bottom: -150px; right: -150px;
}

/* Thai lotus/diamond pattern overlay */
.bg-lotus {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(201,160,64,.04) 40px,
      rgba(201,160,64,.04) 41px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(201,160,64,.04) 40px,
      rgba(201,160,64,.04) 41px
    );
}

/* ── Card shell (centres the card on page) ──────────── */
.card-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--card-w);
  animation: cardReveal .55s cubic-bezier(.22,1,.36,1) both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ── Card body ──────────────────────────────────────── */
.card-body {
  background: var(--card-bg);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(201,160,64,.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;

  /* Subtle inner texture like the reference card */
  background-image:
    radial-gradient(ellipse 120% 60% at 50% 0%,  rgba(240,217,138,.22) 0%, transparent 55%),
    radial-gradient(ellipse 80%  80% at 50% 105%, rgba(201,160,64,.08) 0%, transparent 60%);
}

/* ── Logo section ───────────────────────────────────── */
.logo-section {
  padding: 2rem 2rem .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  animation: fadeUp .5s .1s both;
}

.logo-img {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(139,101,16,.18));
}

/* ── Gold rule ──────────────────────────────────────── */
.rule-gold {
  width: calc(100% - 3rem);
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--g1) 30%, var(--g2) 50%, var(--g1) 70%, transparent);
  margin: 0 1.5rem .1rem;
  border-radius: 999px;
  animation: fadeUp .5s .15s both;
}

/* ── Avatar ─────────────────────────────────────────── */
.avatar-section {
  padding: 1.4rem 0 .5rem;
  animation: fadeUp .5s .2s both;
}

/* Outer decorative ring – thicker, gold gradient */
.avatar-outer-ring {
  width: 180px; height: 200px;
  border-radius: 50%;
  padding: 3.5px;
  background: linear-gradient(145deg, var(--g1) 0%, var(--g2) 45%, var(--gd) 100%);
  box-shadow:
    0 0 0 1px rgba(201,160,64,.15),
    0 6px 24px rgba(139,101,16,.25);
  position: relative;
}

/* Inner white gap ring */
.avatar-inner-ring {
  width: 100%; height: 100%;
  border-radius: 50%;
  padding: 3px;
  background: var(--white);
  overflow: hidden;
}

/* Photo */
.avatar-photo {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  /* fallback gradient if no photo */
  background: linear-gradient(135deg, #ede3c8, #f5eedd);
}

/* ── Name section ───────────────────────────────────── */
.name-section {
  text-align: center;
  padding: .75rem 2rem .1rem;
  animation: fadeUp .5s .25s both;
}

.name-th {
  font-family: var(--font-th);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: .01em;
  line-height: 1.15;
}

.name-en {
  font-family: var(--font-en);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-b);
  margin-top: .2rem;
  letter-spacing: .04em;
}

.position-text {
  font-family: var(--font-en);
  font-size: 1rem;
  font-weight: 500;
  color: var(--g1);
  letter-spacing: .05em;
  margin-top: .35rem;
  font-style: italic;
}

/* position-wrap: EN + TH stacked */
.position-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
  margin-top: .3rem;
}

.position-th {
  font-family: var(--font-th);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-m);
  letter-spacing: .03em;
}

/* ── QR section ─────────────────────────────────────── */
.qr-section {
  width: 100%;
  padding: 0 1.75rem 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  animation: fadeUp .5s .45s both;
}

.qr-label {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
}

.qr-label-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,160,64,.35), transparent);
}

.qr-label-text {
  font-size: .72rem;
  color: var(--text-m);
  letter-spacing: .06em;
  white-space: nowrap;
  font-family: var(--font-th);
}

/* QR frame with centre logo overlay */
.qr-frame {
  position: relative;
  width: 185px; height: 185px;
  border-radius: 14px;
  border: 2px solid rgba(201,160,64,.35);
  background: var(--white);
  padding: 8px;
  box-shadow: 0 4px 18px rgba(139,101,16,.12);
  display: flex; align-items: center; justify-content: center;
}

.qr-img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* Small logo badge centred over QR */
.qr-logo-badge {
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
  padding: 3px;
  pointer-events: none;
}

.qr-logo-img {
  width: 28px; height: 28px;
  object-fit: contain;
}

/* Download QR button */
.btn-dl-qr {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.3rem;
  border-radius: 999px;
  border: 1.5px solid rgba(201,160,64,.5);
  background: rgba(240,217,138,.12);
  color: var(--gd);
  font-family: var(--font-th);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-dl-qr svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
}

.btn-dl-qr:hover {
  background: rgba(201,160,64,.2);
  border-color: var(--g1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,101,16,.2);
}

/* ── Ornamental divider ─────────────────────────────── */
.divider-ornament {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 2.5rem .4rem;
  width: 100%;
  animation: fadeUp .5s .3s both;
}

.div-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--g1), transparent);
}

.div-diamond {
  width: 7px; height: 7px;
  background: var(--g1);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(201,160,64,.5);
  flex-shrink: 0;
}

/* ── Contact list ───────────────────────────────────── */
.contact-list {
  width: 100%;
  padding: .3rem 1.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  animation: fadeUp .5s .35s both;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .5rem .65rem;
  border-radius: var(--r-icon);
  transition: background .2s;
}

.contact-row:hover {
  background: rgba(240,217,138,.25);
}

/* Icon wrapper */
.contact-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-icon);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg { width: 17px; height: 17px; }

.phone-icon {
  background: rgba(201,160,64,.13);
  color: var(--gd);
}

.email-icon {
  background: rgba(201,160,64,.13);
  color: var(--gd);
}

.line-icon {
  background: rgba(0,185,0,.12);
  color: #00A04A;
}

/* ── Address row ────────────────────────────────────── */
.addr-icon {
  background: rgba(201,160,64,.13);
  color: var(--gd);
  align-self: flex-start;   /* pin icon to top when text wraps */
  margin-top: 2px;
}

.addr-text {
  display: flex;
  flex-direction: column;
  gap: .18rem;
}

.addr-th {
  font-size: .88rem;
  color: var(--text-b);
  font-family: var(--font-th);
  line-height: 1.45;
}

.addr-en {
  font-size: .78rem;
  color: var(--text-m);
  font-family: var(--font-en);
  font-style: italic;
  letter-spacing: .02em;
  line-height: 1.4;
}

/* Contact text */
.contact-text {
  font-size: .95rem;
  color: var(--text-b);
  font-weight: 400;
  line-height: 1.3;
  word-break: break-all;
}

/* ── Action buttons ─────────────────────────────────── */
.action-section {
  width: 100%;
  padding: .4rem 1.75rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  animation: fadeUp .5s .4s both;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1.2rem;
  border-radius: var(--r-btn);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  transition: transform .2s, box-shadow .2s, filter .2s;
  position: relative;
  overflow: hidden;
}

.btn-action::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.15) 0%, transparent 50%);
  pointer-events: none;
}

.btn-action:hover   { transform: translateY(-2px); filter: brightness(1.06); }
.btn-action:active  { transform: translateY(0);    filter: brightness(.96);  }

/* Save contact – gold */
.btn-save {
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 50%, var(--gd) 100%);
  color: #3D2200;
  box-shadow: var(--shadow-btn);
}

.btn-save:hover {
  box-shadow: 0 8px 28px rgba(139,101,16,.6);
}

/* LINE – darker gold variant (matching reference image) */
.btn-line {
  background: linear-gradient(135deg, var(--gd) 0%, var(--g1) 60%, var(--gb) 100%);
  color: #FBF0D0;
  box-shadow: 0 6px 20px rgba(80,50,5,.35);
}

.btn-line:hover {
  box-shadow: 0 8px 28px rgba(80,50,5,.5);
}

/* Icon inside button */
.btn-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-icon svg { width: 16px; height: 16px; }

/* Label text */
.btn-label { flex: 1; }

/* Arrow chevron */
.btn-arrow {
  font-size: 1.25rem;
  line-height: 1;
  opacity: .7;
  margin-right: .1rem;
}

/* ── Footer rule ────────────────────────────────────── */
.card-footer-rule {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .75rem 2rem 1.5rem;
  width: 100%;
  animation: fadeUp .5s .45s both;
}

.footer-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,160,64,.35), transparent);
}

.footer-logo-sm {
  height: 22px;
  width: auto;
  object-fit: contain;
  opacity: .55;
  flex-shrink: 0;
}

/* ── Toast ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .75rem 1.5rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  z-index: 999;
  white-space: nowrap;
  animation: toastIn .3s cubic-bezier(.22,1,.36,1) both;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
}

.toast-success {
  background: #F0FBF0;
  border: 1px solid #5CB85C;
  color: #2D7D2D;
}

.toast-error {
  background: #FBF0F0;
  border: 1px solid #D9534F;
  color: #A02020;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Staggered fade-up keyframe ─────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive: very small screens ────────────────── */
@media (max-width: 420px) {
  :root { --card-w: 100%; }
  .card-body { border-radius: 20px; }
  .logo-img  { height: 48px; }
  .name-th   { font-size: 1.5rem; }
  body       { padding: 1rem .75rem; }
}
