:root {
  --bg: #f4f5fb;
  --text: #1c2230;
  --muted: #6b7280;
  --accent: #ff4d6d;
  --accent2: #7c5cff;
  --accent3: #0891b2;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 55%, var(--accent3) 100%);
  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;
  --offline: #9aa4b2;
  --border: rgba(15, 23, 42, 0.09);
  font-family: "IBM Plex Sans Thai", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

* { box-sizing: border-box; }

html, body { height: 100%; min-height: 100vh; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* Soft animated color washes behind every page */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  will-change: transform;
}
.bg-blobs span:nth-child(1) {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  left: -12%; top: -12%;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  animation: floatA 22s ease-in-out infinite;
}
.bg-blobs span:nth-child(2) {
  width: 42vw; height: 42vw; max-width: 560px; max-height: 560px;
  right: -10%; top: 10%;
  background: radial-gradient(circle at 60% 40%, var(--accent2), transparent 70%);
  animation: floatB 26s ease-in-out infinite;
}
.bg-blobs span:nth-child(3) {
  width: 38vw; height: 38vw; max-width: 500px; max-height: 500px;
  left: 20%; bottom: -16%;
  background: radial-gradient(circle at 40% 60%, var(--accent3), transparent 70%);
  animation: floatC 30s ease-in-out infinite;
}
@keyframes floatA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6%, 8%) scale(1.12); } }
@keyframes floatB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-8%, 6%) scale(1.08); } }
@keyframes floatC { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(4%, -8%) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .bg-blobs span { animation: none !important; }
}

.wrap { width: 100%; max-width: 420px; }
.wrap.wide { max-width: 760px; }

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

.card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: 0 10px 34px rgba(31, 41, 55, 0.08);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 18px;
  animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 92, 255, 0.3);
  box-shadow: 0 16px 44px rgba(31, 41, 55, 0.12);
}
.wrap .card:nth-of-type(1) { animation-delay: 0ms; }
.wrap .card:nth-of-type(2) { animation-delay: 80ms; }
.wrap .card:nth-of-type(3) { animation-delay: 160ms; }
.wrap .card:nth-of-type(4) { animation-delay: 240ms; }
.wrap .card:nth-of-type(5) { animation-delay: 320ms; }
.wrap .card:nth-of-type(6) { animation-delay: 400ms; }
@media (prefers-reduced-motion: reduce) {
  .card { animation: none !important; }
}

h1, h2, h3 { margin: 0 0 12px 0; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a { color: var(--accent2); transition: color 0.2s ease; text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
label:first-child { margin-top: 0; }

input[type=text], input[type=email], input[type=password], input[type=file], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #e2e5ee;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:hover, select:hover, textarea:hover { border-color: #cbd0dd; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--gradient);
  background-size: 160% 160%;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.4s ease;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.28);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(124, 92, 255, 0.38); background-position: 100% 0%; color: #fff; text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.97); }
.btn.secondary { background: #eef0f7; color: var(--text); box-shadow: none; }
.btn.secondary:hover { background: #e3e6f1; box-shadow: 0 6px 16px rgba(31,41,55,0.08); color: var(--text); }
.btn.danger { background: linear-gradient(135deg, #dc2626, #f87171); box-shadow: 0 6px 18px rgba(220, 38, 38, 0.25); }
.btn.small { padding: 7px 14px; font-size: 13px; border-radius: 8px; }

@keyframes msgIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.msg { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; animation: msgIn 0.35s ease both; }
.msg.error { background: rgba(220, 38, 38, 0.08); color: #b91c1c; border: 1px solid rgba(220, 38, 38, 0.25); }
.msg.success { background: rgba(22, 163, 74, 0.09); color: #15803d; border: 1px solid rgba(22, 163, 74, 0.25); }

.muted { color: var(--muted); font-size: 13px; }

.top-nav {
  width: 100%;
  max-width: 760px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 20px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.06);
}
.top-nav .brand {
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.top-nav .links { display: flex; gap: 16px; align-items: center; }
.top-nav .links a { color: #4b5364; text-decoration: none; position: relative; }
.top-nav .links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--gradient); transition: width 0.25s ease;
}
.top-nav .links a:hover { color: var(--text); }
.top-nav .links a:hover::after { width: 100%; }

.social-row {
  display: flex; gap: 10px; align-items: center; padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease, padding-left 0.2s ease;
  border-radius: 8px;
}
.social-row:hover { background: rgba(124, 92, 255, 0.05); padding-left: 8px; }
.social-row:last-child { border-bottom: none; }
.social-row .icon-preview {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: #eef0f7; color: var(--accent2); flex-shrink: 0;
}
.social-row .url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }

.bg-preview {
  width: 100%;
  height: 150px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  transition: transform 0.3s ease;
}
.bg-preview:hover { transform: scale(1.01); }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-box {
  flex: 1; min-width: 120px;
  background: #f7f8fc;
  border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.stat-box:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, 0.35); }
.stat-box .num {
  font-size: 26px; font-weight: 700;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-box .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.hero h1 { font-size: 30px; }

.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.08);
}
.lang-switch .lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-switch .lang-btn.active {
  background: var(--gradient);
  color: #fff;
}
.lang-switch .lang-btn:hover:not(.active) { color: var(--text); }
