/* style.css - shared by index.html, admin.html and verify.html */

:root {
  --panel: #f4f6f9;       /* centered column */
  --card: #ffffff;
  --ink: #16181d;
  --muted: #646b76;
  --line: #dfe3e8;
  --accent: #1f3a5f;      /* main brand color: banner, avatar, buttons */
  --accent2: #2b8a9e;     /* second banner color */
  --danger: #b3261e;

  /* link card dots, cycle in this order */
  --c1: #2b8a9e;
  --c2: #f2a900;
  --c3: #e4572e;
  --c4: #5b6fd6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60rem 40rem at 10% -10%, #cfe3ee 0%, transparent 60%),
    radial-gradient(50rem 35rem at 100% 110%, #f6e3c8 0%, transparent 60%),
    #e3e7ec;
  background-attachment: fixed;
}

/* The centered rounded column (used on every page) */
main {
  position: relative;
  overflow: hidden;
  max-width: 36rem;
  min-height: calc(100vh - 3rem);
  margin: 1.5rem auto;
  padding: 2.5rem 1.5rem 3rem;
  background: var(--panel);
  border-radius: 28px;
  box-shadow: 0 10px 40px rgba(22, 40, 70, .12);
}

h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 0; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 2rem 0 .75rem; }
a  { color: var(--accent); }
[hidden] { display: none !important; }
.empty { color: var(--muted); text-align: center; }

/* ---------- Public page ---------- */

.profile { text-align: center; }

/* Colored banner behind the avatar */
.profile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 9rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.22) 0 5rem, transparent 5.1rem),
    radial-gradient(circle at 12% 90%, rgba(255,255,255,.14) 0 4rem, transparent 4.1rem),
    linear-gradient(135deg, var(--accent), var(--accent2));
}

/* Wavy bottom edge on the banner */
.profile::after {
  content: "";
  position: absolute;
  inset: 7.2rem 0 auto 0;
  height: 2rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 40' preserveAspectRatio='none'%3E%3Cpath d='M0 22 Q75 2 150 22 T300 22 T450 22 T600 22 V40 H0Z' fill='%23f4f6f9'/%3E%3C/svg%3E") repeat-x;
  background-size: 50% 100%;
}

.avatar {
  z-index: 1;
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
  position: relative;
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  margin: 3.2rem auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: .02em;
  border: 5px solid var(--panel);
  box-shadow: 0 4px 14px rgba(22, 40, 70, .25);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card); }

.profile h1 { animation: rise .45s .1s ease both; }
.profile h1::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  margin: .6rem auto 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c4));
}

.sub {
  display: inline-block;
  margin: 1rem 0 2rem;
  padding: .25rem .9rem;
  font-size: .9rem;
  color: var(--muted);
  animation: rise .45s .15s ease both;
}

.foot { margin: 2.5rem 0 0; font-size: .85rem; color: var(--muted); }

ul { list-style: none; margin: 0; padding: 0; }
#links { display: grid; gap: .85rem; }

#links li:nth-child(4n+1) { --c: var(--c1); }
#links li:nth-child(4n+2) { --c: var(--c2); }
#links li:nth-child(4n+3) { --c: var(--c3); }
#links li:nth-child(4n+4) { --c: var(--c4); }

a.link {
  position: relative;
  display: block;
  padding: 1.15rem 3rem;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(22, 40, 70, .1);
  transition: transform .15s, box-shadow .15s;
  animation: rise .45s ease both;
}
/* colored dot on the left */
a.link::before {
  content: "";
  position: absolute;
  left: 1.2rem;
  top: 50%;
  width: .7rem;
  height: .7rem;
  margin-top: -.35rem;
  border-radius: 50%;
  background: var(--c, var(--accent));
}
/* arrow that slides in on hover */
a.link::after {
  content: "";
  position: absolute;
  right: 1.3rem;
  top: 50%;
  width: .5rem;
  height: .5rem;
  margin-top: -.25rem;
  border-top: 2px solid var(--c, var(--accent));
  border-right: 2px solid var(--c, var(--accent));
  transform: translateX(-6px) rotate(45deg);
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
a.link:hover::before,
a.link:focus-visible::before { transform: scale(1.5); }
a.link::before { transition: transform .15s; }
a.link:hover::after,
a.link:focus-visible::after { opacity: 1; transform: translateX(0) rotate(45deg); }

a.link:hover,
a.link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 40, 70, .15);
  outline: none;
}
a.link:focus-visible { box-shadow: 0 0 0 3px var(--c, var(--accent)); }

#links li:nth-child(2) a.link { animation-delay: .05s; }
#links li:nth-child(3) a.link { animation-delay: .10s; }
#links li:nth-child(4) a.link { animation-delay: .15s; }
#links li:nth-child(5) a.link { animation-delay: .20s; }
#links li:nth-child(n+6) a.link { animation-delay: .25s; }

@keyframes pop {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: none; }
}

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

/* ---------- Forms and buttons ---------- */

label { display: block; font-weight: 600; font-size: .95rem; margin: 1rem 0 .3rem; }

input {
  width: 100%;
  padding: .7rem .85rem;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
input:focus { border-color: var(--accent); }

button {
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: .55rem 1.1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
button:hover:not(:disabled) { border-color: #b8bdc6; background: #f8f9fa; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: #17304f; border-color: #17304f; }
button.danger { color: var(--danger); }
button.danger:hover:not(:disabled) { border-color: var(--danger); background: #fdf3f2; }
button:disabled { opacity: .35; cursor: default; }

input:focus-visible,
button:focus-visible,
a:focus-visible { outline: 3px solid rgba(31, 58, 95, .35); outline-offset: 2px; }

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

/* ---------- Admin ---------- */

.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.top > div { font-size: .95rem; }

.card { background: var(--card); border-radius: 14px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(22, 40, 70, .1); }

.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }

#list { display: grid; gap: .8rem; }
li.item { background: var(--card); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: 0 1px 3px rgba(22, 40, 70, .1); }
.t { font-weight: 600; overflow-wrap: anywhere; }
.u { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
li.item .row { margin-top: .75rem; }
li.item button { font-size: .85rem; padding: .35rem .8rem; }

.msg { min-height: 1.5em; margin: .75rem 0 0; font-size: .95rem; }
.msg.err { color: var(--danger); }

/* ---------- Verify page ---------- */

body.center { display: grid; place-items: center; min-height: 100vh; text-align: center; padding: 1.5rem; }
body.center p { background: var(--panel); padding: 2rem 2.5rem; border-radius: 20px; margin: 0; box-shadow: 0 10px 40px rgba(22, 40, 70, .12); }

/* ---------- Phones: column fills the screen ---------- */

@media (max-width: 600px) {
  body { background: var(--panel); }
  main { margin: 0; min-height: 100vh; border-radius: 0; padding: 2rem 1.25rem 3rem; box-shadow: none; }
}
