:root {
  --bg-1: #0b1220;
  --bg-2: #1e293b;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #4f46e5;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --border: #e6eaf0;
  --notice-bg: #f6f8fc;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #243a63 0%, transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
}

.card {
  background: var(--card);
  max-width: 540px;
  width: 100%;
  border-radius: var(--radius);
  padding: 30px 28px 24px;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Brand header ---- */
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.brand-text h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.01em; }
.brand-org { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }

h2 {
  font-size: 1.02rem;
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px;
  color: var(--text);
}
h2 svg { color: var(--accent); flex: 0 0 auto; }

.muted { color: var(--muted); font-size: 0.88rem; }
a { color: var(--accent); }

.label-badge {
  display: inline-block;
  margin-top: 14px;
  background: #eef2ff;
  color: var(--accent-2);
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---- Notice ---- */
.notice {
  background: var(--notice-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 18px 0;
}
.notice p { margin: 10px 0; }
.notice p:first-of-type { margin-top: 0; }

.collect-list { list-style: none; margin: 12px 0; padding: 0; }
.collect-list li {
  position: relative;
  padding: 4px 0;
  padding-inline-start: 28px;
  font-size: 0.95rem;
}
.collect-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 9px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.voluntary {
  background: #eff6ff;
  border-inline-start: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

/* ---- Consent + button ---- */
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 18px 2px;
  font-size: 0.95rem;
  cursor: pointer;
}
.consent input {
  margin-top: 3px;
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

button {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform 0.06s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}
button:hover:not(:disabled) { box-shadow: 0 12px 28px rgba(37, 99, 235, 0.42); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.3);
}

.status { margin: 14px 4px 0; font-weight: 600; min-height: 1.2em; text-align: center; }
.status.error { color: var(--danger); }
.status.success { color: var(--ok); }
.status a { display: inline-block; margin-top: 4px; }
.error { color: var(--danger); }

.secure-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 16px 0 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---- Login / forms ---- */
form label { display: block; margin: 14px 0; font-weight: 600; font-size: 0.92rem; }
form input[type="text"],
form input[type="password"],
form input[type="url"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  margin-top: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ---- Admin ---- */
body.admin {
  display: block;
  background: #eef1f6;
  color: var(--text);
  padding: 0;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(2, 6, 23, 0.06);
}
.wide { max-width: 1200px; margin: 24px auto; padding: 0 24px; }
.wide section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.05);
}
.wide h2 { font-size: 1.1rem; }

.row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.row input { flex: 1 1 220px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; }
.row button { width: auto; padding: 11px 18px; box-shadow: none; }
.row .file-field {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}
.row .file-field input[type="file"] {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: #f8fafc; }
.actions { white-space: nowrap; }

.inline { display: inline; }
.link-btn {
  background: none;
  color: var(--accent);
  width: auto;
  padding: 0 6px;
  font-size: 0.9rem;
  box-shadow: none;
  display: inline;
}
.link-btn:hover { background: none; text-decoration: underline; box-shadow: none; }
.link-btn.danger { color: var(--danger); }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
  .card { padding: 24px 20px; }
  body { padding: 20px 12px; }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  .topbar div { display: flex; align-items: center; gap: 10px; }
  .wide { margin: 16px auto; padding: 0 12px; }
  .wide section { padding: 16px; margin-bottom: 16px; }

  .row { flex-direction: column; align-items: stretch; }
  .row input { flex: 1 1 auto; }
  .row button { width: 100%; }

  table { font-size: 0.85rem; }
  th, td { padding: 8px; }
}
