/* Hazina portal styles. Same look as hazinalabs.com. */

/* Tokens */
:root {
  --stone: #EEF0EC;
  --stone-deep: #E3E7E1;
  --paper: #F8F9F6;
  --ink: #16213A;
  --ink-soft: #4B5569;
  --lapis: #2A44B8;
  --lapis-deep: #1E3290;
  --malachite: #12705A;
  --ochre: #C0871C;
  --line: #D3D8D1;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --t-sm: 0.875rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  color-scheme: light;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--stone); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--lapis); text-underline-offset: 0.2em; }
a:hover { color: var(--lapis-deep); }
:focus-visible { outline: 2px solid var(--lapis); outline-offset: 3px; border-radius: 2px; }
.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.4rem;
  font: 600 1rem/1 var(--sans);
  border: 1.5px solid var(--ink); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--stone); }
.btn-primary:hover { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: var(--stone); }
.btn-block { width: 100%; }
.btn-small { min-height: 2.5rem; padding: 0 1.1rem; font-size: .95rem; white-space: nowrap; }

/* Header */
.site-header { background: var(--stone); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4.25rem; }
.nav form { margin: 0; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 500; font-size: 1.4rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand img { width: 30px; height: auto; }

/* Main column */
main { flex: 1; min-width: 0; width: 100%; max-width: 30rem; margin: 0 auto; padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) clamp(3rem, 8vw, 6rem); box-sizing: border-box; }
main.wide { max-width: 52rem; }
main > :first-child { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem); line-height: 1.1; margin: 0 0 1.25rem; }
main.wide h1 { font-size: clamp(2.25rem, 1.5rem + 2.8vw, 3.25rem); }
h2 { font-size: 1.75rem; line-height: 1.2; margin: 2.5rem 0 1rem; }
p { margin: 1rem 0 0; }

/* Card (forms) */
.card { margin-top: 1.5rem; padding: clamp(1.25rem, 4vw, 2rem); background: var(--paper); border-radius: 1rem; box-shadow: inset 0 0 0 1px var(--line); }
.card form + form { margin-top: .75rem; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* Form fields */
label { display: block; margin: 1.1rem 0 .35rem; font-size: var(--t-sm); font-weight: 500; color: var(--ink); }
form > label:first-child, .card > form > label:first-child { margin-top: 0; }
input { width: 100%; font: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: .6rem; padding: .8rem .9rem; min-height: 3rem; }
input:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
form .btn-primary { margin-top: 1.5rem; width: 100%; }
.cf-turnstile { margin-top: 1.25rem; max-width: 100%; overflow: hidden; }

/* Divider */
.divider { margin: 1.5rem 0 1.25rem; font-size: var(--t-sm); font-weight: 500; color: var(--ink-soft); text-align: center; }

/* Notices */
.notice { margin: 1.25rem 0 0; padding: .8rem 1rem; border-radius: .6rem; border: 1px solid #E8C989; background: #FBF1DC; color: var(--ink); font-size: .98rem; line-height: 1.5; overflow-wrap: anywhere; }
.notice.ok { border-color: #9CCBBB; background: #E3F1EC; }

/* Home choices */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.panel { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: 1.25rem; }
.panel h2 { margin: 0; font-size: 1.6rem; }
.panel p { margin: .75rem 0 0; line-height: 1.5; }
.panel-code { background: var(--ink); color: var(--stone); }
.panel-code p { color: #C3CAD8; }
.panel-work { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.panel-work p { color: var(--ink-soft); }
.tag { display: inline-block; margin-top: auto; padding: .4rem .95rem; border-radius: 999px; font-size: .9rem; font-weight: 500; line-height: 1.3; }
.panel p + .tag, .panel .tag { margin-top: 1.5rem; }
.panel-code .tag { background: #243157; color: var(--stone); }
.panel-work .tag { background: var(--stone-deep); color: var(--ink); }

/* Admin */
.invite-form { max-width: 30rem; }
table { width: 100%; margin: 1rem 0 0; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; vertical-align: middle; padding: .75rem .75rem .75rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
th { font-weight: 600; }
td form { margin: 0; }
td .btn { margin: 0; width: auto; }
.pill { display: inline-block; padding: .15rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; line-height: 1.5; background: var(--stone-deep); color: var(--ink); }
.pill-accepted { background: #D4EBE3; color: #0D5444; }
.pill-expired { background: #F6E3B8; color: #6E4A07; }
.table-scroll { overflow-x: auto; }

/* Footer */
.site-footer { background: var(--ink); color: #AEB6C8; padding: 2rem 0 2.5rem; font-size: .875rem; line-height: 1.6; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer a { color: #D4D9E3; }
.site-footer .brand { color: #fff; font-size: 1.15rem; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.site-footer p { margin: 0; }

/* Small screens */
@media (max-width: 700px) {
  .choices { grid-template-columns: 1fr; }
  .nav { height: 3.75rem; }
}
@media (max-width: 600px) {
  .table-scroll table, .table-scroll thead, .table-scroll tbody, .table-scroll tr, .table-scroll th, .table-scroll td { display: block; }
  .table-scroll thead { display: none; }
  .table-scroll td { border-top: 0; padding: .2rem 0; overflow-wrap: break-word; }
  .table-scroll tr { border-top: 1px solid var(--line); padding: .75rem 0; }
  .table-scroll td:first-child { font-weight: 600; overflow-wrap: anywhere; }
  .table-scroll td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
  .table-scroll td:last-child { padding-top: .5rem; }
}
