/* ========================================================
   Vietnam Travel Magazine Order Form Styles
   Matching original Jotform layout with modern responsiveness
   ======================================================== */

:root {
  --primary-color: #f26e63;
  --primary-hover: #e65b50;
  --text-main: #2c3344;
  --text-muted: #6b7280;
  --border-color: #d1d5db;
  --border-focus: #3b82f6;
  --section-header-bg: #e3e7f2;
  --card-bg: #ffffff;
  --page-bg: #f3f5f8;
  --error-color: #ef4444;
  --success-color: #10b981;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--page-bg);
  color: var(--text-main);
  line-height: 1.6;
  padding: 30px 16px 60px;
  -webkit-font-smoothing: antialiased;
}

.form-wrapper {
  max-width: 752px;
  margin: 0 auto;
}

.form-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 0 32px rgba(42, 42, 42, 0.12);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Header Banner */
.banner-container {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Form Container */
.form-content {
  padding: 32px 40px;
}

@media (max-width: 640px) {
  .form-content {
    padding: 24px 18px;
  }
}

/* Form Title */
.form-title-group {
  text-align: center;
  margin-bottom: 28px;
}

.form-title {
  font-size: 21px;
  font-weight: 700;
  color: #2c3344;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Section Bar */
.section-header {
  background-color: var(--section-header-bg);
  border-radius: 4px;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: 20px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.section-header:hover {
  background-color: #dbe0ed;
}

.section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #2c3344;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.section-toggle-icon {
  width: 22px;
  height: 22px;
  background: #c3c9db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 12px;
  transition: transform 0.25s ease;
}

.section-header.collapsed .section-toggle-icon {
  transform: rotate(-90deg);
}

.section-body {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: visible;
}

.section-body.collapsed {
  display: none;
}

/* Form Fields */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: #2c3344;
  margin-bottom: 6px;
}

.form-label .required-star {
  color: var(--error-color);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control.is-invalid {
  border-color: var(--error-color);
  background-color: #fffbfa;
}

.field-error-msg {
  color: var(--error-color);
  font-size: 12.5px;
  margin-top: 4px;
  display: none;
}

.form-control.is-invalid + .field-error-msg {
  display: block;
}

.sublabel {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cascaded Location Selects */
.location-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .location-row {
    grid-template-columns: 1fr;
  }
}

/* Searchable Select Combobox */
.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-control {
  position: relative;
  display: flex;
  align-items: center;
}

.searchable-input {
  padding-right: 32px !important;
  cursor: text;
  background-color: #ffffff;
}

.searchable-input:disabled {
  background-color: #f8fafc;
  cursor: not-allowed;
  color: #94a3b8;
}

.searchable-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  user-select: none;
}

.searchable-select.is-open .searchable-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: #2563eb;
}

.searchable-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 230px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  display: none;
  scrollbar-width: thin;
}

.searchable-select.is-open .searchable-list {
  display: block;
}

.searchable-item {
  padding: 10px 14px;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  transition: background-color 0.12s ease;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.searchable-item:last-child {
  border-bottom: none;
}

.searchable-item:hover,
.searchable-item.is-highlighted {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.searchable-item.is-selected {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

.searchable-empty {
  padding: 14px;
  text-align: center;
  font-size: 13.5px;
  color: #94a3b8;
  font-style: italic;
}

/* Price Tag Banner */
.price-tag-badge {
  text-align: center;
  margin: 10px 0 24px;
}

.price-tag-box {
  display: inline-block;
  border: 2px solid #222222;
  padding: 12px 28px;
  background: #ffffff;
  border-radius: 2px;
}

.price-tag-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.price-tag-price {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
}

/* Form Grid for Qty & Price */
.qty-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .qty-price-row {
    grid-template-columns: 1fr;
  }
}

.form-control[readonly] {
  background-color: #f9fafb;
  font-weight: 700;
  color: #111827;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

/* File Upload Drag & Drop Zone */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  background-color: #f8fafc;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.upload-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 50%;
}

.upload-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.upload-subtext {
  font-size: 13px;
  color: #64748b;
}

.hidden-file-input {
  display: none;
}

/* File Preview */
.file-preview-card {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 10px;
}

.file-preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
}

.file-preview-info {
  flex: 1;
  overflow: hidden;
}

.file-preview-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 12px;
  color: #64748b;
}

.file-preview-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
}

.file-preview-remove:hover {
  background-color: #fee2e2;
}

/* Bank Transfer Info */
.bank-info-box {
  background-color: #fbfcfe;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 18px 20px;
  margin: 24px 0 20px;
  font-size: 14px;
}

.bank-info-title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  font-size: 15px;
}

.bank-info-row {
  margin-bottom: 6px;
  color: #334155;
}

.bank-highlight {
  font-weight: 700;
  color: #0f172a;
}

.copy-btn {
  background: #e2e8f0;
  border: none;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 6px;
  cursor: pointer;
  color: #334155;
  font-weight: 600;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: #cbd5e1;
}

.bank-note {
  margin-top: 10px;
  font-style: italic;
  color: #475569;
}

.bank-warning {
  margin-top: 6px;
  color: #d97706;
  font-weight: 500;
}

/* VietQR Section */
.vietqr-wrapper {
  text-align: center;
  margin: 24px auto;
  max-width: 320px;
}

.vietqr-img-card {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Contact Info Footer */
.contact-footer-box {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
  margin-top: 24px;
  font-size: 14px;
  color: #334155;
  line-height: 1.7;
}

.contact-footer-title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.contact-link {
  color: #2563eb;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

/* Submit Button */
.submit-btn-row {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.btn-submit {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 60px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(242, 110, 99, 0.35);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
}

.btn-submit:hover:not(:disabled) {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(242, 110, 99, 0.45);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-submit.loading .spinner {
  display: inline-block;
}

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

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  max-width: 520px;
  width: 100%;
  border-radius: 12px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-icon-success {
  width: 64px;
  height: 64px;
  background: #ecfdf5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #10b981;
  font-size: 32px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.modal-body {
  font-size: 14.5px;
  color: #475569;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-order-badge {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
  text-align: left;
  font-size: 13.5px;
}

.modal-order-badge div {
  margin-bottom: 4px;
}

.btn-modal-close {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-modal-close:hover {
  background: #1d4ed8;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}
/* Top Admin Gear Button */
.admin-gear-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  z-index: 100;
  text-decoration: none;
}

.admin-gear-btn:hover {
  background: #ffffff;
  color: #1e293b;
  transform: rotate(30deg) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-container {
  position: relative;
}

/* Admin Login Modal */
.admin-modal-card {
  max-width: 420px;
}

.admin-login-icon {
  width: 56px;
  height: 56px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: #2563eb;
  font-size: 26px;
}

.admin-login-input-group {
  margin: 18px 0;
  text-align: left;
}

.admin-login-input-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.admin-login-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14.5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
}

.admin-login-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.admin-login-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.admin-modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-login-cancel {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.btn-login-submit {
  flex: 1;
  background: #2563eb;
  border: none;
  color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.btn-login-submit:hover {
  background: #1d4ed8;
}

/* Password Toggle Eye Button */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 42px !important;
}

.btn-toggle-pwd {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.btn-toggle-pwd:hover {
  color: #1e293b;
}
