:root {
  --ink: #3a2e26;
  --ink-soft: #8a7669;
  --line: #eee0d3;
  --bg: #fdf7f0;
  --card: #ffffff;
  --accent: #d97b4f;
  --accent-dark: #c2653a;
  --accent-soft: #fbe6d8;
  --danger: #c1503a;
  --ok: #5c8a63;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(217, 123, 79, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw;
}

.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-mark {
  font-weight: 800;
  font-size: 1.1rem;
  background: var(--accent);
  color: #fff;
  padding: 3px 10px;
  border-radius: 8px;
}
.brand-name { font-weight: 700; font-size: 1.1rem; color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.lang-toggle { display: inline-flex; background: var(--accent-soft); border-radius: 14px; padding: 3px; }
.lang-toggle button {
  background: transparent; color: var(--ink-soft); border: 0;
  padding: 6px 12px; border-radius: 11px; font-weight: 700; cursor: pointer; font-size: .8rem;
}
.lang-toggle button.active { background: var(--accent); color: #fff; }

.logout-link, .admin-link {
  color: var(--ink-soft); text-decoration: none; font-size: .82rem; font-weight: 700;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px;
}
.logout-link:hover, .admin-link:hover { color: var(--accent); border-color: var(--accent); }

/* Layout */
.container { max-width: 640px; margin: 0 auto; padding: 10px 24px 100px; }
.container.narrow { max-width: 440px; }

.intro { margin-bottom: 24px; }
h1 { font-size: 1.8rem; font-weight: 800; margin: 12px 0 10px; color: var(--ink); }
.lead { color: var(--ink-soft); margin: 0 0 4px; }

/* Card / sections */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
}
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; color: var(--accent); margin: 0 0 18px; font-size: 1.05rem;
}
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

label { display: block; margin-bottom: 18px; }
label > span { display: block; font-weight: 600; margin-bottom: 7px; font-size: .92rem; }

input, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  background: #fffdfb;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { resize: vertical; }

.pin-input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: .5em;
  padding: 14px 13px;
}

.hint { display: block; margin-top: 7px; color: var(--ink-soft); font-size: .82rem; }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff; border: 0;
  padding: 14px 30px;
  border-radius: 14px;
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-small {
  display: inline-block;
  background: var(--accent);
  color: #fff; text-decoration: none;
  padding: 6px 14px; border-radius: 10px; font-size: .85rem; font-weight: 700;
}
.btn-small:hover { background: var(--accent-dark); }

.btn-danger {
  margin-top: 20px;
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger);
  padding: 9px 18px; border-radius: 10px; font-weight: 700; cursor: pointer;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-danger-small { margin-top: 0; padding: 6px 12px; font-size: .82rem; }

.error-box {
  background: #fbeae5; color: var(--danger);
  border: 1px solid #f0c9bd; border-radius: 10px;
  padding: 10px 14px; font-size: .9rem;
}

/* Success */
.success-card { text-align: center; max-width: 520px; margin: 40px auto; }
.success-card .check {
  width: 64px; height: 64px; line-height: 64px; margin: 0 auto 12px;
  background: var(--ok); color: #fff; border-radius: 50%;
  font-size: 2rem; font-weight: 700;
}
.success-card hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.success-card h2 { color: var(--accent); font-size: 1.3rem; margin: 0 0 6px; }

/* Admin table */
.submissions { width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.submissions th, .submissions td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.submissions th { background: var(--accent-soft); color: var(--accent-dark); font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; }
.submissions tr:last-child td { border-bottom: 0; }
.submissions tr:hover td { background: #fff8f2; }

/* Admin detail */
.detail-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.badge { background: var(--accent-soft); color: var(--accent-dark); padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 700; }
.back-link { color: var(--accent); text-decoration: none; font-weight: 700; }
.back-link:hover { text-decoration: underline; }

.answers { margin: 18px 0 0; }
.answers dt { font-weight: 700; color: var(--accent-dark); margin-top: 16px; font-size: .9rem; }
.answers dd { margin: 4px 0 0; padding: 8px 12px; background: #fdf7f0; border-radius: 10px; white-space: pre-wrap; }
.answers dt.sensitive { color: var(--danger); }
.lock { font-weight: 500; font-size: .78rem; color: var(--ink-soft); }

/* Footer */
.site-footer { text-align: center; padding: 26px; color: var(--ink-soft); font-size: .85rem; }

@media (max-width: 560px) {
  .site-header { padding: 14px 18px; }
  .container { padding: 16px 16px 60px; }
  .submissions { font-size: .85rem; }
  .submissions th, .submissions td { padding: 9px 8px; }
}
