:root {
  --color-bg: #eef2f6;
  --color-bg-accent: #dfe9f2;
  --color-surface: #ffffff;
  --color-primary: #0f3f6e;
  --color-primary-dark: #0a2c4d;
  --color-accent: #14958f;
  --color-text: #16232f;
  --color-text-secondary: #55677a;
  --color-border: #d7e0e8;
  --color-error: #c0392b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-card: 0 20px 50px -20px rgba(15, 63, 110, 0.25);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Noto Sans Thai', 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-text);
  background: radial-gradient(1200px 600px at 50% -10%, var(--color-bg-accent), var(--color-bg) 60%);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 20px;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 24px 28px;
  border: 1px solid rgba(15, 63, 110, 0.06);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}

.brand-logo {
  width: 84px;
  height: auto;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
}

.brand-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary-dark);
  letter-spacing: 0.2px;
}

.intro {
  text-align: center;
  margin-bottom: 22px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1.35;
}

.intro p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.feedback-form {
  display: flex;
  flex-direction: column;
}

textarea {
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: #fbfdff;
  resize: vertical;
  min-height: 160px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea::placeholder {
  color: #93a3b3;
}

textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(20, 149, 143, 0.15);
}

textarea.invalid {
  border-color: var(--color-error);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 2px 20px;
  min-height: 18px;
}

.field-error {
  font-size: 13px;
  color: var(--color-error);
  font-weight: 600;
}

.char-count {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-inline-start: auto;
}

.submit-btn {
  position: relative;
  border: none;
  cursor: pointer;
  width: 100%;
  min-height: 58px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px -8px rgba(15, 63, 110, 0.55);
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.submit-btn:active {
  transform: scale(0.98);
}

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

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

.submit-btn.loading .btn-label {
  opacity: 0.85;
}

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

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

.privacy-note {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 18px 0 0;
}

.page-footer {
  margin-top: 18px;
  text-align: center;
}

.page-footer p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  opacity: 0.85;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 26, 43, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.18s ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px 26px 26px;
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4);
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--color-accent);
}

.modal-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal h2 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 800;
  color: var(--color-primary-dark);
}

.modal p {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-secondary);
}

.modal-close-btn {
  border: none;
  cursor: pointer;
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-primary-dark);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
}

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

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Error toast */
.error-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--color-error);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.35);
  z-index: 200;
  max-width: 90%;
  text-align: center;
}

.error-toast[hidden] {
  display: none;
}

@media (min-width: 480px) {
  .card {
    padding: 40px 36px 32px;
  }

  .intro h1 {
    font-size: 28px;
  }
}
