:root {
  color-scheme: light;
  --ink: #14213d;
  --ink-soft: #27375c;
  --paper: #ffffff;
  --paper-soft: #eef3ff;
  --mint: #2962ff;
  --mint-dark: #163aa5;
  --coral: #7457ff;
  --line: rgba(30, 58, 125, 0.11);
  --muted: #66728f;
  --danger: #d9414d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(54, 111, 255, 0.17), transparent 27rem),
    radial-gradient(circle at 82% 22%, rgba(135, 92, 255, 0.14), transparent 25rem),
    linear-gradient(145deg, #f9fbff 0%, #eef3ff 54%, #f8f6ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.62;
  background-image: radial-gradient(rgba(34, 72, 160, 0.17) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

button, input, textarea { font: inherit; }

.topbar, footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar { height: 78px; border-bottom: 1px solid var(--line); }

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 11px;
  background: linear-gradient(145deg, #316cff, #744dff);
  box-shadow: 0 8px 24px rgba(52, 91, 224, 0.28);
}

.brand-mark i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.brand-mark i:nth-child(1) { top: 9px; left: 9px; }
.brand-mark i:nth-child(2) { top: 9px; right: 9px; }
.brand-mark i:nth-child(3) { bottom: 9px; left: 14px; }
.server-address { padding: 8px 12px; border: 1px solid rgba(34, 72, 160, 0.14); border-radius: 999px; color: #55627d; background: rgba(255, 255, 255, 0.54); font-size: 0.82rem; font-weight: 650; backdrop-filter: blur(10px); }

main {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin: 52px auto 50px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 8vw, 110px);
  align-items: start;
}

.intro { padding-top: 34px; position: sticky; top: 30px; }
.eyebrow { margin: 0 0 12px; color: #315fcc; font-size: 0.72rem; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(3.1rem, 6vw, 5.5rem); font-weight: 820; line-height: 0.94; letter-spacing: -0.064em; }
.intro h1 { font-size: clamp(2.65rem, 4.8vw, 4.25rem); line-height: 0.98; }
.no-break { white-space: nowrap; }
.lead { max-width: 520px; margin: 28px 0 34px; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.server-chip { width: fit-content; display: flex; align-items: center; gap: 8px; margin-bottom: 25px; padding: 8px 12px; border: 1px solid rgba(41, 98, 255, 0.16); border-radius: 999px; color: #36517e; background: rgba(255, 255, 255, 0.7); font-size: 0.8rem; font-weight: 720; box-shadow: 0 8px 24px rgba(44, 75, 148, 0.08); }
.server-chip span { width: 7px; height: 7px; border-radius: 50%; background: #28c79a; box-shadow: 0 0 0 4px rgba(40, 199, 154, 0.12); }

.feature-row { display: flex; gap: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.feature-row div { display: flex; align-items: center; gap: 11px; color: #52617f; font-size: 0.82rem; line-height: 1.35; }
.feature-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: #2b5add; background: rgba(255, 255, 255, 0.72); box-shadow: 0 8px 24px rgba(44, 75, 148, 0.09); font-weight: 800; }

.form-card {
  min-height: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 48px);
  box-shadow: 0 28px 80px rgba(47, 65, 119, 0.17), 0 2px 8px rgba(47, 65, 119, 0.06);
}

.form-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 32px; }
.form-heading .eyebrow, .success .eyebrow { color: #315fcc; }
h2 { margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.035em; }
.secure-badge { padding: 8px 11px; border: 1px solid #cdd9f4; border-radius: 999px; color: #3151a0; background: #f5f8ff; font-size: 0.75rem; font-weight: 750; white-space: nowrap; }
.secure-badge span { margin-right: 5px; color: #28b78f; font-size: 0.58rem; }

label { display: block; margin: 18px 0 8px; font-size: 0.88rem; font-weight: 760; }
input, textarea {
  width: 100%;
  border: 1px solid #ccd5e7;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  padding: 13px 14px;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
input:focus, textarea:focus { border-color: #4a70e8; box-shadow: 0 0 0 4px rgba(53, 99, 231, 0.12); }
textarea { resize: vertical; min-height: 92px; }
.matrix-input { display: grid; grid-template-columns: auto minmax(80px, 1fr) auto; align-items: center; overflow: hidden; border: 1px solid #ccd5e7; border-radius: 12px; background: #fff; }
.matrix-input:focus-within { border-color: #4a70e8; box-shadow: 0 0 0 4px rgba(53, 99, 231, 0.12); }
.matrix-input input { border: 0; box-shadow: none; padding-inline: 7px; min-width: 0; }
.matrix-input span { color: #5b716c; font-size: 0.9rem; }
.matrix-input span:first-child { padding-left: 14px; }
.matrix-input span:last-child { padding-right: 14px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint, .privacy-note { margin: 8px 0 0; color: #657a75; font-size: 0.78rem; line-height: 1.45; }
.optional { color: #6d7f7b; font-weight: 500; }
.field-error, .form-error { min-height: 0; margin: 5px 0 0; color: #b4382d; font-size: 0.78rem; line-height: 1.35; }
.field-error:not(:empty), .form-error:not(:empty) { min-height: 18px; }
.availability-status { min-height: 0; margin: 5px 0 0; color: #657a75; font-size: 0.78rem; line-height: 1.35; }
.availability-status:not(:empty) { min-height: 18px; }
.availability-status.available { color: #187552; }
.availability-status.unavailable { color: #b4382d; }
.honeypot { position: absolute; left: -10000px; }

.consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: #405550; font-weight: 500; line-height: 1.45; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #3563e9; }
.primary-button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  margin-top: 18px;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, #2962ff, #6548e8);
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(55, 82, 198, 0.25);
  transition: transform 150ms, filter 150ms, box-shadow 150ms;
}
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 16px 34px rgba(55, 82, 198, 0.31); }
.primary-button:disabled { cursor: wait; opacity: 0.65; transform: none; }

.success { padding: 36px 0; }
.success-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 34px; border-radius: 20px; color: #fff; background: linear-gradient(145deg, #2b66ff, #704cff); box-shadow: 0 14px 32px rgba(55, 82, 198, 0.25); font-size: 1.8rem; }
.success > p:not(.eyebrow, .privacy-note) { color: #526762; line-height: 1.65; }
.success dl { margin: 32px 0; border-top: 1px solid #cbdad6; }
.success dl div { padding: 15px 0; display: grid; grid-template-columns: 130px 1fr; border-bottom: 1px solid #cbdad6; }
.success dt { color: #60746f; font-size: 0.84rem; }
.success dd { margin: 0; font-weight: 750; word-break: break-word; }
.test-mail-link { display: inline-flex; margin: 0 0 20px; border-radius: 10px; padding: 11px 14px; color: #244fc2; background: #edf2ff; font-size: 0.84rem; font-weight: 780; text-decoration: none; }
.test-mail-link:hover { background: #e1e9ff; }
.test-mail-link[hidden] { display: none; }

footer { padding: 24px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }
footer a { color: var(--primary); font-weight: 700; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.auth-shell { display: grid; grid-template-columns: 1fr; width: min(100% - 40px, 560px); margin: 72px auto; }
.auth-card { padding: clamp(26px, 5vw, 48px); border: 1px solid rgba(255,255,255,.92); border-radius: 24px; background: var(--paper); box-shadow: 0 28px 80px rgba(47,65,119,.17), 0 2px 8px rgba(47,65,119,.06); }
.auth-card h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1; }
.auth-card .lead { margin: 18px 0 26px; font-size: .98rem; }
.auth-card form { display: grid; gap: 2px; }
.auth-card form + form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.auth-card .button { margin-top: 14px; }
.form-message { min-height: 22px; margin: 10px 0 0; color: var(--muted); line-height: 1.45; }
@media (max-width: 620px) { .auth-shell { width: min(100% - 24px, 560px); margin: 32px auto; } }

@media (max-width: 850px) {
  main { grid-template-columns: 1fr; margin-top: 20px; }
  .intro { position: static; padding-top: 18px; }
  .feature-row { display: none; }
  h1 { font-size: clamp(2.8rem, 13vw, 4.5rem); }
  .lead { margin-bottom: 12px; }
}

@media (max-width: 580px) {
  .topbar, main, footer { width: min(100% - 24px, 1180px); }
  .topbar { height: 72px; }
  .server-address { font-size: 0; width: 9px; height: 9px; padding: 0; border: 0; background: #28c79a; box-shadow: 0 0 0 5px rgba(40, 199, 154, 0.12); }
  main { gap: 28px; }
  .form-card { min-height: 0; padding: 24px 18px; border-radius: 20px; }
  .intro h1 { font-size: clamp(2.05rem, 10vw, 3.1rem); letter-spacing: -0.055em; }
  .form-heading { display: block; }
  .secure-badge { display: inline-block; margin-top: 14px; }
  .two-columns { grid-template-columns: 1fr; gap: 0; }
  .matrix-input span:last-child { font-size: 0.75rem; padding-right: 9px; }
  footer { align-items: start; gap: 10px; flex-direction: column; }
}

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

.admin-body {
  min-height: 100vh;
  color: #f6f8ff;
  background:
    radial-gradient(circle at 10% 10%, rgba(48, 103, 255, 0.2), transparent 30rem),
    linear-gradient(145deg, #07142a 0%, #0b1833 52%, #10152d 100%);
}
.admin-body .topbar { border-color: rgba(235, 241, 255, 0.13); }
.admin-body .brand { color: #f6f8ff; }
.admin-main { display: block; max-width: 1180px; margin-top: 52px; }
.login-card { width: min(520px, 100%); margin: 8vh auto 0; padding: 44px; border: 1px solid var(--line); border-radius: 24px; background: rgba(7, 27, 35, 0.84); backdrop-filter: blur(16px); }
.login-card h1 {
  max-width: 100%;
  margin-bottom: 30px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  overflow-wrap: break-word;
}
.dashboard h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.text-button { border: 0; color: var(--paper-soft); background: transparent; cursor: pointer; }
.outline-button { border: 1px solid #b9d1ca; border-radius: 10px; padding: 11px 15px; color: #173f34; background: transparent; font-weight: 760; cursor: pointer; }
.admin-body .outline-button { color: var(--paper); border-color: var(--line); }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 34px; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.summary-card { border: 1px solid var(--line); border-radius: 16px; padding: 17px 18px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); background: rgba(13, 42, 51, 0.68); cursor: pointer; text-align: left; }
.summary-card strong { color: var(--paper); font-family: Georgia, serif; font-size: 1.8rem; font-weight: 400; }
.summary-card.active { border-color: rgba(85, 230, 177, 0.7); color: var(--paper); background: rgba(21, 60, 52, 0.85); }
.application-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.application-card { padding: 24px; color: var(--ink); background: var(--paper); border-radius: 20px 20px 20px 5px; }
.application-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.application-topline time { color: #6f827e; font-size: 0.78rem; }
.status-pill { border-radius: 999px; padding: 6px 9px; font-size: 0.72rem; font-weight: 800; }
.status-pill.pending { color: #715200; background: #f6e8ad; }
.status-pill.approved { color: #07513d; background: #c8f2df; }
.status-pill.rejected { color: #8a2c22; background: #ffd8d1; }
.application-identity { display: flex; align-items: center; gap: 13px; }
.application-identity h2 { font-family: inherit; font-size: 1.12rem; font-weight: 800; }
.application-identity p { margin: 3px 0 0; color: #58706a; font-size: 0.84rem; word-break: break-all; }
.avatar { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #0b4837; background: #c8f2df; font-family: Georgia, serif; font-size: 1.3rem; }
.application-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid #d0ded9; }
.application-details div.full { grid-column: 1 / -1; }
.application-details dt { color: #6b7e79; font-size: 0.72rem; }
.application-details dd { margin: 4px 0 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.card-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.application-card .outline-button { color: #923a30; border-color: #e0b6af; }
.primary-button.compact { width: auto; margin: 0; padding: 11px 16px; }
.danger-button { color: #fff; background: #c14b3c; }
.empty-state { grid-column: 1 / -1; min-height: 240px; display: grid; place-content: center; justify-items: center; gap: 8px; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); }
.empty-state b { color: var(--paper); font-size: 1.1rem; }
dialog { width: min(480px, calc(100% - 24px)); border: 0; border-radius: 20px; padding: 30px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55); }
dialog::backdrop { background: rgba(2, 14, 18, 0.78); backdrop-filter: blur(3px); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
dialog .outline-button { color: #405550; }

@media (max-width: 760px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .application-list { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: start; }
}

@media (max-width: 520px) {
  .login-card { padding: 28px 20px; }
  .summary { grid-template-columns: 1fr; }
  .dashboard-heading { display: block; }
  .dashboard-heading .outline-button { margin-top: 20px; }
  .application-details { grid-template-columns: 1fr; }
  .application-details div.full { grid-column: auto; }
}
