/* ============================================
   TravelWinners B2B — Shared Styles
   ============================================ */
:root {
  --forest: #1B5E3B;
  --forest-dark: #144A2E;
  --forest-deep: #0D3620;
  --forest-light: #E8F5EC;
  --forest-mist: #F4FAF6;
  --gold: #C8A951;
  --gold-light: #F5F0E0;
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E8E8E8;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --red: #DC2626;
  --green-check: #16A34A;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --transition: all .3s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: 'DM Sans', 'Noto Sans KR', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ---- Language Switcher ---- */
.lang-switch {
  display: inline-flex; gap: 2px; background: var(--white);
  border-radius: 20px; padding: 3px;
  border: 1px solid var(--gray-200);
}
.lang-btn {
  padding: 6px 14px; border: none; border-radius: 17px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--gray-500);
  transition: var(--transition); font-family: 'DM Sans', sans-serif;
}
.lang-btn.active { background: var(--forest); color: var(--white); }

/* Top bar for auth pages — holds lang switch + optional actions */
.form-topbar {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 12px; margin-bottom: 24px;
}
.form-topbar .lang-switch { box-shadow: var(--shadow); }

/* ---- Shell Layout ---- */
.shell { display: flex; min-height: 100vh; }

.brand-panel {
  width: 420px; min-height: 100vh;
  background: linear-gradient(165deg, var(--forest-deep) 0%, var(--forest) 50%, var(--forest-dark) 100%);
  padding: 48px 40px; display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
}
.brand-panel::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(200,169,81,.08) 0%, transparent 70%);
  pointer-events: none;
}
.brand-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 60px; }
.brand-logo-icon {
  width: 44px; height: 44px; background: var(--gold);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; font-weight: 700;
  color: var(--forest-deep); font-family: 'Fraunces', serif;
}
.brand-logo-text { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--white); }
.brand-logo-link { text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand-headline {
  font-family: 'Fraunces', serif; font-size: 32px; font-weight: 700;
  color: var(--white); line-height: 1.3; margin-bottom: 20px;
}
.brand-sub {
  font-size: 15px; color: rgba(255,255,255,.65);
  line-height: 1.7; margin-bottom: 48px;
}
.brand-footer {
  font-size: 12px; color: rgba(255,255,255,.3);
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 20px; line-height: 1.6;
}

/* ---- Steps Nav ---- */
.steps-nav { display: flex; flex-direction: column; margin-bottom: auto; }
.step-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; position: relative; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute; left: 15px; top: 48px;
  bottom: -16px; width: 2px; background: rgba(255,255,255,.12);
}
.step-item.active:not(:last-child)::after { background: var(--gold); opacity: .4; }
.step-item.completed:not(:last-child)::after { background: var(--gold); }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.3);
  flex-shrink: 0; transition: var(--transition);
}
.step-item.active .step-circle { border-color: var(--gold); background: var(--gold); color: var(--forest-deep); }
.step-item.completed .step-circle { border-color: var(--gold); color: var(--gold); }
.step-label { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.35); padding-top: 5px; transition: var(--transition); }
.step-label-sub { font-size: 12px; color: rgba(255,255,255,.2); margin-top: 3px; }
.step-item.active .step-label { color: var(--white); }
.step-item.active .step-label-sub { color: rgba(255,255,255,.55); }
.step-item.completed .step-label { color: rgba(255,255,255,.6); }

/* ---- Form Panel ---- */
.form-panel {
  flex: 1; margin-left: 420px;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 60px; min-height: 100vh;
}
.form-container { width: 100%; max-width: 520px; }

/* ---- Form Elements ---- */
.form-title { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.form-desc { font-size: 15px; color: var(--gray-500); margin-bottom: 36px; line-height: 1.6; }
.field-group { margin-bottom: 24px; }
.field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 8px;
  letter-spacing: .3px; text-transform: uppercase;
}
.field-label .optional { font-weight: 400; color: var(--gray-400); text-transform: none; font-size: 12px; }
.input-wrap { position: relative; }
.field-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 15px; font-family: 'DM Sans', sans-serif;
  color: var(--gray-800); background: var(--white);
  transition: var(--transition); outline: none;
}
.field-input::placeholder { color: var(--gray-400); }
.field-input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(27,94,59,.08); }
.field-input.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.field-input.has-toggle { padding-right: 70px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 6px; display: none; }
.field-error.show { display: block; }
.field-hint { font-size: 12px; color: var(--gray-400); margin-top: 6px; line-height: 1.5; }

/* ---- Password ---- */
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: var(--gray-100); border: 1px solid var(--gray-300);
  cursor: pointer; font-size: 11px; color: var(--gray-600);
  padding: 5px 12px; user-select: none; border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-weight: 600;
  letter-spacing: .5px; z-index: 2;
}
.pw-toggle:hover { color: var(--gray-800); border-color: var(--gray-500); background: var(--gray-200); }
.pw-requirements {
  margin-top: 12px; padding: 14px 16px;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
.pw-req-title { font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.pw-req-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px; color: var(--gray-400);
  transition: var(--transition);
}
.pw-req-item.met { color: var(--green-check); }
.pw-req-ico {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: var(--transition); flex-shrink: 0;
}
.pw-req-item.met .pw-req-ico { border-color: var(--green-check); background: var(--green-check); color: var(--white); }
.pw-strength { display: flex; gap: 4px; margin-top: 10px; }
.pw-bar { height: 3px; flex: 1; background: var(--gray-200); border-radius: 2px; transition: var(--transition); }
.pw-bar.weak { background: var(--red); }
.pw-bar.med { background: var(--gold); }
.pw-bar.strong { background: var(--green-check); }
.pw-strength-label { font-size: 12px; margin-top: 6px; font-weight: 500; }
.pw-strength-label.weak { color: var(--red); }
.pw-strength-label.medium { color: var(--gold); }
.pw-strength-label.strong { color: var(--green-check); }

/* ---- Checkbox ---- */
.check-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; user-select: none; }
.check-box {
  width: 20px; height: 20px; border: 1.5px solid var(--gray-300);
  border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); margin-top: 1px; cursor: pointer;
}
.check-box.checked { background: var(--forest); border-color: var(--forest); }
.check-box.checked::after { content: '✓'; color: white; font-size: 12px; font-weight: 700; }
.check-text { font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.check-text a { color: var(--forest); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Buttons ---- */
.btn-primary {
  width: 100%; padding: 16px 24px; background: var(--forest);
  color: var(--white); border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: var(--transition); font-family: 'DM Sans', sans-serif;
}
.btn-primary:hover { background: var(--forest-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(27,94,59,.25); }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  width: 100%; padding: 14px 24px; background: transparent;
  color: var(--gray-500); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  font-family: 'DM Sans', sans-serif; margin-top: 12px; text-align: center;
  display: block; text-decoration: none;
}
.btn-secondary:hover { border-color: var(--gray-300); color: var(--gray-700); }
.btn-row { display: flex; gap: 12px; margin-top: 32px; }
.btn-row .btn-primary { flex: 1; }
.btn-back {
  padding: 14px 20px; background: transparent; color: var(--gray-500);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: 'DM Sans', sans-serif; white-space: nowrap;
}
.btn-back:hover { border-color: var(--gray-400); color: var(--gray-700); }
.btn-danger {
  padding: 10px 20px; background: transparent; color: var(--gray-400);
  border: none; font-size: 13px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; margin-top: 16px;
  text-align: center; width: 100%;
}
.btn-danger:hover { color: var(--red); }
.btn-fetch {
  padding: 14px 20px; background: var(--forest-light); color: var(--forest);
  border: 1.5px solid var(--forest); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; white-space: nowrap;
}
.btn-fetch:hover { background: var(--forest); color: var(--white); }

/* ---- Misc ---- */
.or-divider { display: flex; align-items: center; gap: 16px; margin: 28px 0; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.or-divider span { font-size: 12px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 1px; }
.agoda-fetch-row { display: flex; gap: 10px; }
.agoda-fetch-row .field-input { flex: 1; }

/* Hotel Preview */
.hotel-preview {
  display: none; margin-top: 24px; background: var(--white);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  overflow: hidden; animation: fadeUp .4s ease;
}
.hotel-preview.show { display: block; }
.hotel-preview-header { padding: 20px 24px; background: var(--forest-mist); border-bottom: 1px solid var(--gray-200); }
.hotel-preview-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--forest); color: var(--white);
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.hotel-preview-badge::before { content: '✓'; font-size: 10px; }
.hotel-preview-body { padding: 24px; }
.hotel-name-display { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.hotel-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.hotel-meta-item { font-size: 13px; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.hotel-stars { color: var(--gold); font-size: 14px; letter-spacing: 2px; margin-top: 4px; }
.hotel-edit-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}
.hotel-edit-grid .field-group { margin-bottom: 0; }

/* Toast */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-900); color: var(--white);
  padding: 14px 24px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; z-index: 9999;
  transition: transform .3s ease; box-shadow: var(--shadow-lg);
  max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); }

/* Spinner */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-right: 8px; vertical-align: middle;
}
.spinner-dark { border-color: rgba(27,94,59,.2); border-top-color: var(--forest); }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes successPop { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---- Dashboard Styles ---- */
.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}
.dash-welcome { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; color: var(--gray-900); }
.dash-email { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.dash-logout {
  padding: 8px 16px; background: transparent; color: var(--gray-500);
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.dash-logout:hover { border-color: var(--red); color: var(--red); }

/* Order Card */
.order-card { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.order-card-top { padding: 28px; border-bottom: 1px dashed var(--gray-200); }
.order-product-name { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.order-product-desc { font-size: 14px; color: var(--gray-500); line-height: 1.6; }
.order-features { padding: 24px 28px; border-bottom: 1px dashed var(--gray-200); }
.order-feature { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.order-feature:not(:last-child) { border-bottom: 1px solid var(--gray-100); }
.order-feature-check {
  width: 20px; height: 20px; background: var(--forest-light);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 10px; color: var(--forest); flex-shrink: 0;
}
.order-feature-text { font-size: 14px; color: var(--gray-600); line-height: 1.5; }
.order-pricing { padding: 24px 28px; }
.order-price-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.order-price-label { font-size: 14px; color: var(--gray-500); }
.order-price-value { font-size: 14px; color: var(--gray-700); font-weight: 500; }
.order-price-total { border-top: 2px solid var(--gray-800); margin-top: 12px; padding-top: 14px; }
.order-price-total .order-price-label { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.order-price-total .order-price-value { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; color: var(--forest); }
.refund-note {
  margin-top: 20px; padding: 14px 18px;
  background: var(--forest-mist); border-radius: var(--radius-sm);
  border-left: 3px solid var(--forest);
}
.refund-note-title { font-size: 12px; font-weight: 700; color: var(--forest); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.refund-note-text { font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.secure-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 12px; color: var(--gray-400); }

/* Success */
.success-wrap { text-align: center; padding: 40px 0; }
.success-ico {
  width: 80px; height: 80px; background: var(--forest-light);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 28px;
  font-size: 36px; color: var(--forest); animation: successPop .5s ease;
}
.success-title { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; }
.success-desc { font-size: 15px; color: var(--gray-500); line-height: 1.6; max-width: 400px; margin: 0 auto 32px; }
.success-next-box {
  background: var(--forest-mist); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 24px; text-align: left; margin-bottom: 24px;
}
.success-next-title { font-size: 13px; font-weight: 700; color: var(--forest); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 16px; }
.success-next-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.success-next-num {
  width: 24px; height: 24px; background: var(--forest);
  color: var(--white); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.success-next-text { font-size: 14px; color: var(--gray-600); line-height: 1.5; padding-top: 2px; }

/* Responsive */
@media (max-width: 960px) {
  .brand-panel { display: none; }
  .form-panel { margin-left: 0; padding: 32px 24px; }
  .hotel-edit-grid { grid-template-columns: 1fr; }
  .dash-header { flex-wrap: wrap; gap: 12px; }
}
