/* =====================================================================
   ADA 2026 – Registration Modal
   Matches site design: dark #0b0c10, accent #66fcf1, mono font, sharp corners
   ===================================================================== */

/* ---- overlay ---- */
.reg-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(11, 12, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  /* prevents child animations from causing page scroll */
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease, cubic-bezier(.23, 1, .32, 1)),
    visibility .35s var(--ease, cubic-bezier(.23, 1, .32, 1));
}

.reg-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---- modal box ---- */
.reg-modal {
  position: relative;
  background: var(--bg-color, #0b0c10);
  border: 1px solid rgba(102, 252, 241, 0.2);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(102, 252, 241, .05),
    0 0 60px rgba(102, 252, 241, .1),
    0 30px 80px rgba(0, 0, 0, .7);
  transform: translateY(24px) scale(.97);
  transition: transform .4s var(--ease, cubic-bezier(.23, 1, .32, 1));
}

.reg-modal-overlay.active .reg-modal {
  transform: translateY(0) scale(1);
}

/* scrollbar for body */
.reg-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 40px 40px;
  /* Top padding 0 because header has bottom margin/padding */
  scrollbar-width: thin;
  scrollbar-color: var(--accent, #66fcf1) #1f2833;
}

.reg-body::-webkit-scrollbar {
  width: 4px;
}

.reg-body::-webkit-scrollbar-track {
  background: var(--surface, #1f2833);
}

.reg-body::-webkit-scrollbar-thumb {
  background: var(--accent, #66fcf1);
}

/* ---- corner brackets (matches .hud-border-tl style in site) ---- */
.reg-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent, #66fcf1);
  border-style: solid;
  z-index: 2;
  pointer-events: none;
  opacity: .6;
  transition: opacity .3s;
}

.reg-modal:hover .reg-corner {
  opacity: 1;
}

.reg-tl {
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
}

.reg-tr {
  top: 6px;
  right: 6px;
  border-width: 2px 2px 0 0;
}

.reg-bl {
  bottom: 6px;
  left: 6px;
  border-width: 0 0 2px 2px;
}

.reg-br {
  bottom: 6px;
  right: 6px;
  border-width: 0 2px 2px 0;
}

/* ---- 4-sided rotating border (conic-gradient, no overflow) ---- */
@property --reg-border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.reg-modal::after {
  content: '';
  position: absolute;
  inset: 0;
  /* stays within modal – no overflow */
  z-index: 4;
  padding: 1px;
  /* border thickness */
  background: conic-gradient(from var(--reg-border-angle),
      transparent 0deg,
      transparent 70deg,
      rgba(102, 252, 241, .15) 100deg,
      #66fcf1 130deg,
      rgba(102, 252, 241, .15) 160deg,
      transparent 190deg,
      transparent 360deg);
  /* mask: show only the 1px padding ring, hide the fill */
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: regBorderRotate 4s linear infinite;
}

@keyframes regBorderRotate {
  from {
    --reg-border-angle: 0deg;
  }

  to {
    --reg-border-angle: 360deg;
  }
}

/* ---- header ---- */
.reg-header {
  padding: 32px 36px 20px;
  position: relative;
}

.reg-header-line {
  height: 1px;
  background: linear-gradient(90deg, rgba(102, 252, 241, .4), rgba(69, 162, 158, .2), transparent);
  margin: 10px 0;
}

.reg-title {
  margin: 10px 0;
  display: flex;
  align-items: baseline;
  gap: 0;
  flex-wrap: wrap;
  font-family: var(--font-heading, 'Manrope', sans-serif);
}

.reg-title-ada {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-color, #ededed);
  letter-spacing: -.04em;
}

.reg-title-year {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent, #66fcf1);
  letter-spacing: -.04em;
  margin-right: 14px;
}

.reg-title-sub {
  font-size: .75rem;
  color: var(--accent-dark, #45a29e);
  font-family: var(--font-mono, 'Space Mono', monospace);
  letter-spacing: .12em;
  text-transform: uppercase;
  width: 100%;
  margin-top: 2px;
}

/* HUD tag style like site's .hud-coords */
.reg-header::before {
  content: 'REGISTRATION // INIT';
  display: block;
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: .68rem;
  color: var(--accent-dark, #45a29e);
  letter-spacing: .15em;
  opacity: .6;
  margin-bottom: 8px;
}

.reg-close {
  position: absolute;
  top: 20px;
  right: 22px;
  background: none;
  border: none;
  color: rgba(237, 237, 237, .3);
  font-size: 1.8rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .2s, transform .25s var(--ease, cubic-bezier(.23, 1, .32, 1));
  line-height: 1;
  padding: 0;
}

.reg-close:hover {
  color: var(--accent, #66fcf1);
  transform: rotate(90deg) scale(1.15);
  text-shadow: 0 0 14px rgba(102, 252, 241, .6);
}

/* ---- body ---- */


/* ---- form rows ---- */
.reg-row {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.reg-field {
  flex: 1;
  position: relative;
}

.reg-field.full {
  flex: 1 1 100%;
}

/* ---- inputs (floating label) ---- */
.reg-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(31, 40, 51, .6);
  /* --surface tinted */
  border: 1px solid rgba(102, 252, 241, .12);
  color: var(--text-color, #ededed);
  font-size: .92rem;
  padding: 20px 14px 7px;
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
  font-family: var(--font-heading, 'Manrope', sans-serif);
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  /* sharp corners like site */
}

.reg-input:focus {
  border-color: var(--accent, #66fcf1);
  background: rgba(102, 252, 241, .04);
  box-shadow: 0 0 0 1px rgba(102, 252, 241, .1),
    inset 0 0 12px rgba(102, 252, 241, .04);
}

/* ---- autofill override (browsers don't allow direct bg-color change) ---- */
.reg-input:-webkit-autofill,
.reg-input:-webkit-autofill:hover,
.reg-input:-webkit-autofill:focus,
.reg-input:-webkit-autofill:active {
  /* Large inset shadow paints over the browser's autofill yellow/blue */
  -webkit-box-shadow: 0 0 0 1000px #1a2130 inset !important;
  box-shadow: 0 0 0 1000px #1a2130 inset !important;
  /* Keep text readable */
  -webkit-text-fill-color: #ededed !important;
  caret-color: var(--accent, #66fcf1);
  /* Delay bg-color transition to effectively freeze autofill colour */
  transition: background-color 86400s ease, color 86400s ease;
  border-color: rgba(102, 252, 241, .2);
}

.reg-input.reg-invalid {
  border-color: #ff4d6d !important;
  box-shadow: 0 0 0 1px rgba(255, 77, 109, .2);
}

.reg-input::placeholder {
  color: transparent;
}

/* textarea */
.reg-textarea {
  padding: 14px;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.reg-textarea::placeholder {
  color: rgba(237, 237, 237, .25);
  font-size: .86rem;
}

/* floating label */
.reg-label {
  position: absolute;
  top: 14px;
  left: 14px;
  color: rgba(237, 237, 237, .35);
  font-size: .86rem;
  font-family: var(--font-mono, 'Space Mono', monospace);
  pointer-events: none;
  transition: top .2s, font-size .2s, color .2s;
  letter-spacing: .03em;
}

.reg-input:focus+.reg-label,
.reg-input:not(:placeholder-shown)+.reg-label {
  top: 5px;
  font-size: .67rem;
  color: var(--accent, #66fcf1);
  letter-spacing: .08em;
}

/* accent underline */
.reg-field-line {
  height: 1px;
  background: linear-gradient(90deg, var(--accent, #66fcf1), rgba(69, 162, 158, .3), transparent);
  margin-top: 1px;
  opacity: 0;
  transition: opacity .25s;
}

.reg-input:focus~.reg-field-line {
  opacity: 1;
}

/* ---- select ---- */
.reg-select-wrap {
  position: relative;
}

.reg-select {
  cursor: pointer;
  padding-right: 36px;
}

.reg-select option {
  background: var(--surface, #1f2833);
  color: var(--text-color, #ededed);
}

.reg-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-dark, #45a29e);
  pointer-events: none;
  font-size: 1rem;
  font-family: var(--font-mono, monospace);
}

/* label behaviour for select */
.reg-select:focus+.reg-label,
.reg-select:valid+.reg-label {
  top: 5px;
  font-size: .67rem;
  color: var(--accent, #66fcf1);
  letter-spacing: .08em;
}

/* ---- alert ---- */
.reg-alert {
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: .88rem;
  line-height: 1.6;
  font-family: var(--font-mono, 'Space Mono', monospace);
  border-radius: 0;
  border-left: 3px solid;
  animation: regAlertIn .3s var(--ease, cubic-bezier(.23, 1, .32, 1));
}

@keyframes regAlertIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reg-alert-success {
  background: rgba(102, 252, 241, .07);
  border-color: var(--accent, #66fcf1);
  color: var(--accent, #66fcf1);
}

.reg-alert-error {
  background: rgba(255, 77, 109, .07);
  border-color: #ff4d6d;
  color: #ff6b85;
}

.reg-alert-warning {
  background: rgba(69, 162, 158, .1);
  border-color: var(--accent-dark, #45a29e);
  color: var(--accent-dark, #45a29e);
}

/* ---- submit button — mirrors site's .btn-primary ---- */
.reg-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.reg-submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(102, 252, 241, .02);
  color: var(--accent, #66fcf1);
  border: 1px solid rgba(102, 252, 241, .25);
  padding: 1.1rem 3rem;
  font-size: .88rem;
  font-weight: 700;
  font-family: var(--font-mono, 'Space Mono', monospace);
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: all .4s var(--ease, cubic-bezier(.23, 1, .32, 1));
  min-width: 200px;
  border-radius: 0;
  /* sharp, matches site */
  z-index: 1;
}

/* neural grid bg — mirrors btn-primary::before */
.reg-submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-image:
    linear-gradient(rgba(102, 252, 241, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 252, 241, .1) 1px, transparent 1px);
  background-size: 14px 14px;
  transform: translate(-25%, -25%) rotate(15deg);
  opacity: 0;
  transition: opacity .4s;
  z-index: -2;
}

/* scan line — mirrors btn-primary::after */
.reg-submit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 252, 241, .35), transparent);
  z-index: -1;
}

.reg-submit-btn:not(:disabled):hover {
  color: var(--text-color, #ededed);
  border-color: var(--accent, #66fcf1);
  transform: translateY(-5px);
  box-shadow:
    0 0 30px rgba(102, 252, 241, .25),
    inset 0 0 15px rgba(102, 252, 241, .15);
  text-shadow:
    2px 0 #ff00ff44,
    -2px 0 #00ffff44;
}

.reg-submit-btn:not(:disabled):hover::before {
  opacity: 1;
  animation: regGridMove 10s linear infinite;
}

.reg-submit-btn:not(:disabled):hover::after {
  animation: regScanLine 2s var(--ease, cubic-bezier(.23, 1, .32, 1)) infinite;
}

.reg-submit-btn:disabled {
  opacity: .5;
  cursor: default;
}

@keyframes regGridMove {
  0% {
    transform: translate(-25%, -25%) rotate(15deg);
  }

  100% {
    transform: translate(-10%, -10%) rotate(15deg);
  }
}

@keyframes regScanLine {
  0% {
    left: -100%;
  }

  50% {
    left: 100%;
  }

  100% {
    left: 100%;
  }
}

/* ---- spinner ---- */
.reg-btn-loader {
  display: inline-flex;
  align-items: center;
}

.reg-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(102, 252, 241, .2);
  border-top-color: var(--accent, #66fcf1);
  border-radius: 50%;
  animation: regSpinAnim .7s linear infinite;
}

@keyframes regSpinAnim {
  to {
    transform: rotate(360deg);
  }
}

/* ---- required mark ---- */
.req {
  color: var(--accent, #66fcf1);
  font-size: .8em;
}

/* ---- responsive ---- */
@media (max-width: 580px) {
  .reg-row {
    flex-direction: column;
    gap: 24px;
  }

  .reg-header {
    padding: 24px 20px 16px;
  }

  .reg-body {
    padding: 0 20px 26px;
  }

  .reg-title-ada,
  .reg-title-year {
    font-size: 1.5rem;
  }
}