@import url('/assets/fonts/kanit.css');

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 85% 0%, #fff1f2 0%, transparent 36%), linear-gradient(#fbfbfd, #f2f4f8);
  font-family: 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #16191f;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
}

.page {
  width: min(100%, 460px);
  min-height: 100svh;
  margin: auto;
  padding: 32px 18px 28px;
}

/* Brand Header */
.brand {
  text-align: center;
  margin: 4px 0 28px;
}

.brand-mark {
  width: 72px;
  height: 50px;
  display: block;
  margin: 0 auto 10px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(223, 35, 51, 0.15));
}

.brand h1 {
  font-weight: 700;
  letter-spacing: -0.5px;
  font-size: clamp(30px, 8vw, 38px);
  line-height: 1.25;
  margin: 0;
  color: #11141a;
}

.brand p {
  font-size: 13.5px;
  line-height: 1.6;
  color: #68707c;
  margin: 6px auto 0;
  max-width: 340px;
  font-weight: 300;
}

/* Exactly 4 Primary Link Cards */
.links {
  display: grid;
  gap: 12px;
  width: 100%;
}

.link-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 96px;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 253, 0.88));
  box-shadow: 0 10px 24px rgba(38, 46, 62, 0.08), 0 2px 6px rgba(38, 46, 62, 0.03);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  width: 100%;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.link-card:active {
  transform: scale(0.985);
}

.link-card:hover {
  box-shadow: 0 14px 28px rgba(38, 46, 62, 0.12);
}

.link-card:focus-visible,
.social-link:focus-visible,
.modal-close:focus-visible,
.submit-btn:focus-visible {
  outline: 3px solid #df2333;
  outline-offset: 3px;
}

.link-card.is-featured {
  background: linear-gradient(125deg, #fffafb, #fff1f3);
  border: 1px solid rgba(255, 225, 230, 0.7);
}

.link-card.is-unavailable {
  cursor: default;
  opacity: 0.68;
}

.link-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.link-copy {
  min-width: 0;
  overflow: hidden;
}

.link-title {
  display: block;
  font-weight: 600;
  font-size: clamp(14.5px, 3.8vw, 17px);
  line-height: 1.35;
  color: #12151b;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.link-subtitle {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #727b88;
  line-height: 1.45;
  font-weight: 300;
}

.chevron {
  width: 9px;
  height: 9px;
  border-top: 2.2px solid #858d9a;
  border-right: 2.2px solid #858d9a;
  transform: rotate(45deg);
  justify-self: end;
}

/* Social Section */
.social-section {
  scroll-margin-top: 16px;
  padding-top: 36px;
  text-align: center;
}

.social-section h2 {
  font-size: 13.5px;
  font-weight: 500;
  color: #5b6471;
  margin: 0 0 16px;
  letter-spacing: -0.2px;
}

.social-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.social-link {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(37, 43, 56, 0.08);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.social-link img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 14px;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(37, 43, 56, 0.14);
}

.social-link:active {
  transform: scale(0.95);
}

.social-link.is-unavailable {
  opacity: 0.45;
  cursor: default;
}

footer {
  text-align: center;
  font-size: 11px;
  color: #9199a6;
  margin-top: 36px;
  line-height: 1.6;
  font-weight: 300;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 22, 33, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: #ffffff;
  width: min(100%, 420px);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 28px;
  padding: 26px 22px 24px;
  box-shadow: 0 24px 48px rgba(22, 28, 42, 0.22);
  position: relative;
  animation: slideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: #8b93a0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: #f1f3f6;
  color: #12151b;
}

.modal-header {
  text-align: center;
  margin-bottom: 16px;
}

.modal-icon {
  margin: 0 auto 10px;
  display: block;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: #11141a;
  letter-spacing: -0.3px;
}

.modal-header p {
  font-size: 13px;
  color: #68707c;
  margin: 6px 0 0;
  line-height: 1.5;
  font-weight: 300;
}

.stat-badge {
  background: #fff1f2;
  border: 1px solid #ffd6da;
  color: #df2333;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 20px;
  text-align: center;
  margin-bottom: 18px;
}

.stat-badge strong {
  font-weight: 700;
}

/* Forms */
.modal-form {
  display: grid;
  gap: 14px;
}

.form-group {
  display: grid;
  gap: 5px;
  text-align: left;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
}

.form-group label .required {
  color: #df2333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #e2e5eb;
  background: #fafbfc;
  font-size: 14px;
  color: #16191f;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper select {
  width: 100%;
  padding: 12px 38px 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #e2e5eb;
  background: #fafbfc;
  font-size: 14px;
  color: #16191f;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.select-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid #6b7280;
  border-right: 2px solid #6b7280;
  transform: translateY(-65%) rotate(135deg);
  pointer-events: none;
}

.form-group input:focus,
.select-wrapper select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #df2333;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(223, 35, 51, 0.12);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  margin: 2px 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #555e6d;
  line-height: 1.45;
  cursor: pointer;
  font-weight: 300;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #df2333;
  width: 16px;
  height: 16px;
}

.turnstile-container {
  min-height: 0;
  display: flex;
  justify-content: center;
  margin: 2px 0;
}

.form-feedback {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.45;
  text-align: center;
  font-weight: 500;
}

.form-feedback.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.form-feedback.is-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.submit-btn {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(135deg, #e62234, #c81325);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(223, 35, 51, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  padding: 12px 18px;
  letter-spacing: -0.2px;
}

.submit-btn:hover {
  box-shadow: 0 10px 24px rgba(223, 35, 51, 0.36);
}

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

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

/* Animations & Media Queries */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 380px) {
  .page {
    padding-inline: 12px;
  }
  .link-card {
    grid-template-columns: 66px minmax(0, 1fr) 14px;
    min-height: 90px;
    padding-right: 12px;
    gap: 8px;
  }
  .link-icon {
    width: 64px;
    height: 64px;
  }
  .link-title {
    font-size: 14.5px;
  }
  .social-row {
    gap: 6px;
  }
  .social-link {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .social-link img {
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
