/* ============================================================
 * KT BEAUTY EMAIL SIGNATURE GENERATOR — WEB UI ONLY
 * Lưu ý: CSS này CHỈ dùng cho giao diện generator.
 * HTML signature được generate bằng inline CSS riêng trong
 * js/signature.js (email-safe), KHÔNG dùng stylesheet này.
 * ============================================================ */

:root {
  --brand: #b8a088;
  --brand-dark: #9d8266;
  --ink: #222222;
  --muted: #6f6f6f;
  --line: #e5e0da;
  --bg: #faf8f6;
  --panel: #ffffff;
  --error: #b3261e;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--panel);
  border-bottom: 3px solid var(--brand);
  padding: 28px 24px;
  text-align: center;
}

.site-header .brand {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 4px;
  color: var(--brand-dark);
}

.site-header h1 {
  margin: 6px 0 0;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--ink);
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-width: 0; /* cho phép preview 580px scroll ngang thay vì phá layout grid */
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-dark);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

/* ---------- Form ---------- */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 5px;
  color: var(--ink);
}

.field .optional {
  font-weight: normal;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.field input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  display: block;
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--error);
}

.form-actions {
  margin-top: 20px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.btn-danger-armed {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

/* ---------- Brand variant toggle ---------- */

.variant-toggle {
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.variant-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.variant-toggle input {
  accent-color: var(--brand);
  cursor: pointer;
}

/* ---------- Preview ---------- */

.preview-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
}

.signature-preview {
  width: 580px; /* giữ đúng chiều rộng signature trong email */
  max-width: none;
}

/* ---------- Action bar ---------- */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  max-width: 90vw;
  padding: 12px 20px;
  font-size: 14px;
  border-radius: 6px;
  background: #2e2a26;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-error {
  background: var(--error);
}

/* ---------- Gmail guide ---------- */

.guide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 40px;
}

.guide h2 {
  margin: 0 0 14px;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--brand-dark);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink);
}

.guide-steps li {
  margin-bottom: 20px;
}

.guide-steps p {
  margin: 0 0 10px;
  line-height: 1.7;
}

.guide-img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.guide-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .site-header {
    padding: 20px 16px;
  }

  .site-header h1 {
    font-size: 18px;
  }

  .action-bar {
    padding: 16px;
  }

  .action-bar .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
