:root {
  --bg: #0b1220;
  --panel: #0f1a2e;
  --text: #e9eefc;
  --muted: rgba(233, 238, 252, 0.7);
  --brand: #00b3ff;
  --brand2: #00ffb2;
  --danger: #ff4d4f;
  --success: #2ecc71;
  --warning: #f7b731;
  --border: rgba(233, 238, 252, 0.14);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 30% 10%, rgba(0, 179, 255, 0.20), transparent 55%),
              radial-gradient(1200px 600px at 70% 10%, rgba(0, 255, 178, 0.14), transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.78);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.brand__logo {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  background: rgba(15, 26, 46, 0.55);
}

.brand__name {
  font-weight: 700;
  letter-spacing: 0.02rem;
}

.nav {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav__link:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(15, 26, 46, 0.35);
}

.container {
  width: min(68.75rem, calc(100% - 2rem));
  margin: 1.5rem auto 4rem;
  flex: 1;
}

.panel {
  border: 1px solid var(--border);
  background: rgba(15, 26, 46, 0.62);
  border-radius: 1rem;
  padding: 1.125rem;
}

.auth-panel {
  width: 100%;
  max-width: 25rem;
  margin-left: auto;
  margin-right: auto;
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 1.125rem 0;
}

.auth-logo {
  width: 100%;
  max-width: 20rem;
  height: auto;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(15, 26, 46, 0.35);
}

@media (max-width: 600px) {
  .auth-logo { max-width: 12.5rem; }
}

@media (min-width: 1024px) {
  .auth-logo { max-width: 25rem; }
}

.hero {
  display: grid;
  gap: 1rem;
  padding: 1.375rem;
}

.hero__title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.15;
}

.hero__subtitle {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 0.875rem;
  background: rgba(11, 18, 32, 0.30);
  overflow-wrap: anywhere;
}

.card__label {
  color: var(--muted);
  font-size: 0.875rem;
}

.card__value {
  margin-top: 0.375rem;
  font-size: 1.625rem;
  font-weight: 700;
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.30);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  touch-action: manipulation;
}

.btn--primary {
  border-color: rgba(0, 179, 255, 0.35);
  background: linear-gradient(135deg, rgba(0, 179, 255, 0.18), rgba(0, 255, 178, 0.10));
}

.btn--danger {
  border-color: rgba(255, 77, 79, 0.35);
  background: rgba(255, 77, 79, 0.10);
}

.form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.625rem;
}

.field {
  display: grid;
  gap: 0.375rem;
}

.field__error {
  color: rgba(255, 77, 79, 0.92);
  font-size: 0.875rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.input--error {
  border-color: rgba(255, 77, 79, 0.6) !important;
}

.label {
  font-size: 0.875rem;
  color: var(--muted);
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.40);
  color: var(--text);
  outline: none;
  font-size: 1rem;
}

input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: rgba(0, 179, 255, 0.55);
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.check-grid {
  display: grid;
  gap: 0.625rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.check-item {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.22);
  overflow-wrap: anywhere;
}

.check-item input[type="checkbox"], .check-item input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  flex: 0 0 auto;
}

.check-item span {
  line-height: 1.25;
}

.section-title {
  margin: 0.875rem 0 0;
  font-size: 1.125rem;
}

.section-subtitle {
  margin: 0.625rem 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  table-layout: fixed;
}

.table th, .table td {
  text-align: left;
  padding: 0.625rem 0.625rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  overflow-wrap: anywhere;
}

.table th { color: var(--muted); font-weight: 600; }

.alert {
  padding: 0.75rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  margin: 0.625rem 0 1rem;
  overflow-wrap: anywhere;
}

.alert--success { border-color: rgba(46, 204, 113, 0.35); background: rgba(46, 204, 113, 0.12); }
.alert--danger { border-color: rgba(255, 77, 79, 0.35); background: rgba(255, 77, 79, 0.12); }
.alert--warning { border-color: rgba(247, 183, 49, 0.35); background: rgba(247, 183, 49, 0.10); }

.footer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.78);
  backdrop-filter: blur(12px);
}

.footer__inner {
  width: min(68.75rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.75rem 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.footer__inner a {
  color: rgba(0, 179, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 0.125rem;
}

.footer__inner a:hover {
  color: rgba(0, 255, 178, 0.92);
}

.field__hint {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  min-height: 1.125rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.hint__status[data-registration-status="ok"] { color: rgba(46, 204, 113, 0.92); }
.hint__status[data-registration-status="taken"] { color: rgba(255, 77, 79, 0.92); }
.hint__status[data-registration-status="error"] { color: rgba(247, 183, 49, 0.95); }

.hint__spinner {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  border: 2px solid rgba(233, 238, 252, 0.25);
  border-top-color: rgba(0, 179, 255, 0.9);
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dropzone {
  border: 1px dashed rgba(233, 238, 252, 0.25);
  border-radius: 0.875rem;
  background: rgba(11, 18, 32, 0.22);
  padding: 0.75rem;
  cursor: pointer;
  outline: none;
}

.dropzone:focus {
  border-color: rgba(0, 179, 255, 0.65);
  box-shadow: 0 0 0 0.125rem rgba(0, 179, 255, 0.18);
}

.dropzone--over {
  border-color: rgba(0, 255, 178, 0.65);
  background: rgba(0, 255, 178, 0.06);
}

.dropzone__inner {
  display: grid;
  gap: 0.75rem;
  align-items: center;
  grid-template-columns: 1fr;
}

.avatar-preview {
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 26, 46, 0.35);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dropzone__title { font-weight: 700; }
.dropzone__subtitle { color: var(--muted); font-size: 0.875rem; margin-top: 0.125rem; }

.progress {
  width: 100%;
  height: 0.625rem;
  border-radius: 999px;
  background: rgba(233, 238, 252, 0.12);
  margin-top: 0.625rem;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(0, 179, 255, 0.85), rgba(0, 255, 178, 0.7));
}

.form__message {
  min-height: 1.125rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.form__message[data-type="error"] { color: rgba(255, 77, 79, 0.92); }
.form__message[data-type="success"] { color: rgba(46, 204, 113, 0.92); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 50;
}

.modal__panel {
  width: min(32.5rem, 100%);
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(15, 26, 46, 0.92);
  backdrop-filter: blur(12px);
  padding: 1rem;
}

.modal__title {
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.steps {
  display: grid;
  gap: 0.625rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--muted);
}

.step__dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  border: 2px solid rgba(233, 238, 252, 0.25);
}

.step[data-state="active"] { color: var(--text); }
.step[data-state="active"] .step__dot { border-color: rgba(0, 179, 255, 0.9); }
.step[data-state="done"] { color: rgba(46, 204, 113, 0.92); }
.step[data-state="done"] .step__dot { border-color: rgba(46, 204, 113, 0.92); background: rgba(46, 204, 113, 0.42); }
.step[data-state="error"] { color: rgba(255, 77, 79, 0.92); }
.step[data-state="error"] .step__dot { border-color: rgba(255, 77, 79, 0.92); background: rgba(255, 77, 79, 0.32); }

@media (min-width: 768px) {
  .dropzone__inner {
    grid-template-columns: auto 1fr;
  }
  .avatar-preview {
    width: 6rem;
    height: 6rem;
  }
}

@media (min-width: 1024px) {
  .profile-panel { max-width: 35rem; }
}

@media (min-width: 1440px) {
  .profile-panel { max-width: 37.5rem; }
}

.assessment-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.assessment-btn {
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 0.875rem;
  background: rgba(11, 18, 32, 0.30);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 3.875rem;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  overflow-wrap: anywhere;
}

.assessment-btn:hover {
  transform: translateY(-0.0625rem);
  border-color: rgba(0, 179, 255, 0.35);
  background: rgba(11, 18, 32, 0.42);
}

.assessment-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.assessment-btn__title {
  font-weight: 750;
  flex: 1 1 auto;
  min-width: 0;
}

.assessment-btn__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.assessment-status {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 26, 46, 0.35);
}

.assessment-status--ok {
  color: rgba(46, 204, 113, 0.92);
  border-color: rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.10);
}

.assessment-status--pending {
  color: rgba(255, 77, 79, 0.92);
  border-color: rgba(255, 77, 79, 0.35);
  background: rgba(255, 77, 79, 0.10);
}

.assessment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--muted);
  background: rgba(15, 26, 46, 0.35);
}

.assessment-chip--ok {
  border-color: rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.10);
  color: rgba(46, 204, 113, 0.92);
}

.assessment-chip--pending {
  border-color: rgba(247, 183, 49, 0.35);
  background: rgba(247, 183, 49, 0.08);
  color: rgba(247, 183, 49, 0.95);
}

@media (max-width: 414px) {
  .topbar {
    padding: 0.75rem 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
  }

  .brand__name {
    font-size: 1rem;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    justify-content: stretch;
  }

  .nav__link {
    width: 100%;
  }

  .container {
    width: calc(100% - 1.5rem);
    margin: 1rem auto 3rem;
  }

  .panel {
    padding: 0.875rem;
  }

  .hero {
    padding: 1rem;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .grid,
  .check-grid,
  .assessment-grid {
    grid-template-columns: 1fr;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .actions .btn,
  .row .btn,
  .row button.btn {
    width: 100%;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.5rem;
  }
}

@media (max-width: 375px) {
  .hero__title {
    font-size: 1.4rem;
  }

  .brand__name {
    font-size: 0.95rem;
  }
}

@media (max-width: 320px) {
  .nav {
    grid-template-columns: 1fr;
  }

  .hero__title {
    font-size: 1.3rem;
  }
}

@media (max-width: 414px) and (orientation: landscape) {
  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
