/* ===================================================================
   HỆ THỐNG ĐĂNG KÝ HỌC VIÊN - PHONG CÁCH VĂN HÓA DÂN GIAN VIỆT NAM
   Chủ đề: Trống Đồng, Hoa Sen, Tre Xanh, Sơn Mài Truyền Thống
=================================================================== */

:root {
  /* Bảng màu Sơn Mài & Dân Gian Việt Nam */
  --bg-deep-lacquer: #120302;
  --bg-dark-wood: #1E0604;
  --gold-primary: #D4AF37;
  --gold-light: #FDE047;
  --gold-dark: #854D0E;
  
  --ink-brown: #3E1B0A;
  --ink-dark: #240F04;
  --parchment: #FBF5E8;
  --parchment-border: #D9C3A3;
  
  --lacquer-red: #881337;
  --lacquer-red-hover: #9F1239;
  
  --text-title-gold: #FDE68A;
  --text-body-cream: #E2D9C8;
  --text-muted-gold: #C2A781;
  
  --font-display: 'Playfair Display', Georgia, serif;
  --font-serif: 'Cinzel', 'Playfair Display', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep-lacquer);
  color: var(--text-body-cream);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 1. NỀN MỜ ÊM DỊU, KHÔNG HÌNH TRÒN GÂY RỐI MẮT */
.vietnamese-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, #2A0805 0%, #160403 60%, #0A0101 100%);
  overflow: hidden;
}

/* Hào quang vàng kim êm dịu phía sau khung tranh */
.lantern-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.glow-top {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, rgba(180, 83, 9, 0.05) 50%, transparent 80%);
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
}

.glow-bottom {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(136, 19, 55, 0.12) 0%, transparent 70%);
  bottom: -120px;
  right: 10%;
}

/* Làn sương mây khói mờ ảo truyền thống */
.traditional-clouds {
  position: absolute;
  width: 500px;
  height: 250px;
  background: radial-gradient(ellipse, rgba(212, 175, 55, 0.03) 0%, transparent 70%);
  filter: blur(60px);
}

.cloud-left {
  top: 25%;
  left: -100px;
}

.cloud-right {
  bottom: 20%;
  right: -100px;
}

/* 2. KHUNG BỐ CỤC CHÍNH */
.page-container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Header Tiêu Đề */
.app-header {
  text-align: center;
  margin-bottom: 22px;
  max-width: 600px;
}

.badge-heritage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-primary);
  padding: 5px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.heritage-dot {
  width: 5px;
  height: 5px;
  background-color: var(--gold-primary);
  border-radius: 50%;
}

.main-title-heritage {
  font-family: var(--font-display);
  font-size: clamp(26px, 5.5vw, 36px);
  font-weight: 800;
  color: var(--text-title-gold);
  line-height: 1.25;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.25);
}

.subtitle-heritage {
  font-size: 14px;
  color: var(--text-muted-gold);
  line-height: 1.55;
  max-width: 520px;
  margin: 0 auto;
}

/* 3. KHUNG POSTER TRANH DÂN GIAN & FORM OVERLAY */
.poster-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.poster-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 864 / 1152; /* Tỷ lệ ảnh gốc */
  filter: drop-shadow(0 25px 40px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 30px rgba(212, 175, 55, 0.15));
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.poster-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Lớp Form phủ lên đúng từng tọa độ */
.poster-form-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Định vị từng ô Input theo tọa độ % chính xác tuyệt đối */
.field-slot {
  position: absolute;
  display: flex;
  align-items: center;
}

/* Ô 1: Họ & Tên */
.slot-name {
  left: 27.2%;
  top: 42.5%;
  width: 45.4%;
  height: 5.0%;
}

/* Ô 2: Số Zalo */
.slot-zalo {
  left: 27.2%;
  top: 53.0%;
  width: 45.4%;
  height: 5.0%;
}

/* Ô 3: Email */
.slot-email {
  left: 27.2%;
  top: 63.6%;
  width: 45.4%;
  height: 5.0%;
}

/* Ô 4: Nút Đăng Ký */
.slot-submit {
  left: 33.0%;
  top: 71.3%;
  width: 33.6%;
  height: 6.2%;
}

/* Style cho các ô Input phong cách Dân Gian (Trong suốt, tiệp màu tranh) */
.heritage-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: clamp(13px, 2.7vw, 16px);
  font-weight: 600;
  color: var(--ink-dark);
  outline: none;
  transition: all 0.2s ease;
}

.heritage-input::placeholder {
  color: rgba(120, 53, 15, 0.4);
  font-size: clamp(11.5px, 2.3vw, 13.5px);
  font-style: italic;
  font-weight: 400;
}

/* Khi bấm vào ô nhập */
.heritage-input:focus {
  background: rgba(255, 253, 245, 0.45);
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 0 2.5px rgba(212, 175, 55, 0.45), inset 0 1px 3px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
}

/* Tránh lỗi trình duyệt tự đổ màu trắng khi autofill */
.heritage-input:-webkit-autofill,
.heritage-input:-webkit-autofill:hover, 
.heritage-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #FDF8ED inset !important;
  -webkit-text-fill-color: #240F04 !important;
  border-radius: 12px;
}

/* Trạng thái lỗi: Viền đỏ tinh tế không che chữ bên dưới */
.field-slot.has-error .heritage-input {
  border-color: #DC2626 !important;
  background: rgba(254, 226, 226, 0.4) !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35) !important;
}

.field-slot.has-success .heritage-input {
  border-color: rgba(5, 150, 105, 0.6);
}

/* Thông báo lỗi gọn gàng */
.slot-feedback {
  display: none; /* Dùng Toast thông báo để không che mất nhãn bên dưới */
}

/* Nút Submit Đăng Ký (Phủ lên nút đỏ sơn mài trong tranh) */
.heritage-submit-btn {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(15px, 3.2vw, 20px);
  font-weight: 800;
  color: transparent;
  transition: all 0.2s ease;
}

.heritage-submit-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 18px rgba(234, 179, 8, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.2);
  border-color: rgba(253, 224, 71, 0.5);
}

.heritage-submit-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.heritage-submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Khi đang lưu dữ liệu */
.btn-loader-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #FFF8E7;
  font-size: clamp(12px, 2.5vw, 15px);
  background: rgba(136, 19, 55, 0.95);
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--gold-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.heritage-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(253, 224, 71, 0.3);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* 4. THANH CAM KẾT DƯỚI TRANH */
.trust-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  background: rgba(26, 6, 4, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 8px 20px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted-gold);
  font-weight: 500;
}

.trust-icon {
  width: 14px;
  height: 14px;
  color: var(--gold-primary);
}

.trust-sep {
  color: rgba(212, 175, 55, 0.4);
  font-size: 10px;
}

.heritage-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(191, 168, 136, 0.8);
}

.footer-link {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* 5. MODAL THÀNH CÔNG KIỂU THIỆP GẤM CỔ TRUYỀN */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 2, 1, 0.85);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.heritage-modal-card {
  background: var(--parchment);
  color: var(--ink-dark);
  width: 100%;
  max-width: 460px;
  border-radius: 18px;
  border: 2.5px solid var(--gold-primary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 35px rgba(212, 175, 55, 0.3);
  overflow: hidden;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.modal-heritage-header {
  background: linear-gradient(135deg, #7C1D1D 0%, #450A0A 100%);
  color: #FFF8E7;
  padding: 24px 20px 18px;
  border-bottom: 2px solid var(--gold-primary);
}

.lotus-icon-wrapper {
  width: 56px;
  height: 56px;
  background: var(--gold-primary);
  color: #450A0A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  border: 3px solid #FEF08A;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lotus-icon {
  width: 28px;
  height: 28px;
}

.modal-heritage-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #FEF08A;
  margin-bottom: 4px;
}

.modal-heritage-subtitle {
  font-size: 13px;
  color: #FDE68A;
}

.modal-heritage-body {
  padding: 20px 22px 24px;
}

.parchment-ticket {
  background: #FFFDF9;
  border: 1px dashed var(--parchment-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: left;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  padding: 6px 0;
  border-bottom: 1px solid #F3E8D8;
}

.ticket-row:last-child {
  border-bottom: none;
}

.ticket-label {
  color: #78350F;
  font-weight: 600;
}

.ticket-val {
  color: var(--ink-dark);
}

.instruction-box {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #5C2C16;
  text-align: left;
  line-height: 1.45;
  margin-bottom: 20px;
}

.btn-heritage-close {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #881337 0%, #4C0519 100%);
  color: #FEF08A;
  border: 1px solid var(--gold-primary);
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(76, 5, 25, 0.4);
  transition: all 0.2s ease;
}

.btn-heritage-close:hover {
  background: linear-gradient(135deg, #9F1239 0%, #640A22 100%);
  box-shadow: 0 6px 16px rgba(76, 5, 25, 0.6);
}

/* 6. TOAST NOTIFICATION */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  background: #FFFDF9;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  border-left: 4px solid var(--gold-primary);
  color: var(--ink-dark);
  animation: slideInRight 0.25s ease;
}

.toast.toast-error {
  border-left-color: #DC2626;
  background: #FEF2F2;
  color: #991B1B;
}

.toast.toast-success {
  border-left-color: #059669;
  background: #ECFDF5;
  color: #065F46;
}

.toast.toast-warning {
  border-left-color: #D97706;
  background: #FFFBEB;
  color: #92400E;
}

.toast-icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  line-height: 1.4;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive Cho Mobile */
@media (max-width: 580px) {
  .page-container {
    padding: 20px 10px 30px;
  }
  
  .main-title-heritage {
    font-size: 24px;
  }
  
  .poster-frame {
    border-radius: 16px;
  }

  .trust-banner {
    padding: 6px 14px;
    gap: 8px;
  }
  
  .trust-item {
    font-size: 11.5px;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }
}
