/* ===========================================================
   CNC — Codesphere Nexus Cyber — Register page
   Glassmorphism · floating bubbles · brand greens
   =========================================================== */

:root {
  --primary:        #14532D;
  --primary-light:  #166534;
  --secondary:      #22C55E;
  --secondary-light:#DCFCE7;

  --ink:        #0F2A1B;
  --ink-muted:  #3F6B51;
  --ink-faint:  #7FA98E;

  --glass-bg:     rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --field-bg:     rgba(255, 255, 255, 0.55);
  --field-border: rgba(20, 83, 45, 0.14);

  --red: #E0473D;

  --font-display: 'Sora', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius-lg: 30px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(120% 100% at 85% -10%, rgba(34,197,94,0.22), transparent 55%),
    radial-gradient(100% 90% at 5% 110%, rgba(20,83,45,0.20), transparent 55%),
    linear-gradient(160deg, #F3FBF6 0%, var(--secondary-light) 45%, #EAF9F0 100%);
  background-attachment: fixed;
}

a { color: inherit; }

.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* =========================== AMBIENT BACKGROUND =========================== */

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}

.blob--1 {
  width: 520px; height: 520px;
  top: -180px; left: -140px;
  background: radial-gradient(circle at 30% 30%, var(--secondary), var(--primary-light) 70%);
}

.blob--2 {
  width: 460px; height: 460px;
  bottom: -160px; right: -120px;
  background: radial-gradient(circle at 60% 40%, var(--primary), var(--secondary) 75%);
  opacity: 0.4;
}

.blob--3 {
  width: 360px; height: 360px;
  top: 40%; right: 8%;
  background: radial-gradient(circle, var(--secondary-light), transparent 70%);
  opacity: 0.7;
}

/* floating glass bubbles */

.bubbles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%,
    rgba(255,255,255,0.85) 0%,
    rgba(255,255,255,0.25) 28%,
    rgba(34,197,94,0.18) 65%,
    rgba(20,83,45,0.10) 100%);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    inset -6px -6px 14px rgba(20,83,45,0.10),
    inset 5px 6px 10px rgba(255,255,255,0.55),
    0 8px 24px rgba(20,83,45,0.08);
  animation: drift 14s ease-in-out infinite;
}

.b1 { width: 120px; height: 120px; left: 6%;  top: 12%; animation-duration: 16s; }
.b2 { width: 64px;  height: 64px;  left: 14%; top: 68%; animation-duration: 12s; animation-delay: -3s; }
.b3 { width: 90px;  height: 90px;  left: 82%; top: 18%; animation-duration: 18s; animation-delay: -6s; }
.b4 { width: 46px;  height: 46px;  left: 90%; top: 62%; animation-duration: 11s; animation-delay: -1s; }
.b5 { width: 150px; height: 150px; left: 78%; top: 78%; animation-duration: 20s; animation-delay: -8s; }
.b6 { width: 36px;  height: 36px;  left: 46%; top: 8%;  animation-duration: 10s; animation-delay: -4s; }
.b7 { width: 70px;  height: 70px;  left: 4%;  top: 82%; animation-duration: 15s; animation-delay: -10s; }
.b8 { width: 28px;  height: 28px;  left: 60%; top: 90%; animation-duration: 9s;  animation-delay: -2s; }
.b9 { width: 100px; height: 100px; left: 40%; top: 88%; animation-duration: 17s; animation-delay: -5s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(14px, -22px) scale(1.04); }
  100% { transform: translate(0, 0) scale(1); }
}

/* =========================== AUTH CARD =========================== */

.auth-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 30px 60px -20px rgba(20, 83, 45, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.7);
  padding: 44px 40px 38px;
}

.brand-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  box-shadow: 0 10px 24px -8px rgba(20, 83, 45, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}

.brand-badge__glyph {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #FFFFFF;
}

.form-head {
  text-align: center;
  margin-bottom: 28px;
}

.form-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 25px;
  color: var(--primary);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.form-head__hint {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
  padding: 0 6px;
}

/* ---- fields ---- */

.field { margin-bottom: 18px; }

.field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 7px;
}

.field__label-note {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 12px;
}

.field__checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
  cursor: pointer;
  margin-bottom: 7px;
  user-select: none;
}
.field__checkbox-inline input { accent-color: var(--secondary); }

.field__control {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(20,83,45,0.05);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field__control:focus-within {
  background: rgba(255,255,255,0.85);
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.18);
}

.field__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
}

.field__input::placeholder { color: var(--ink-faint); }

.field__input--select {
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23166534' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 38px;
}
.field__input--select option { background: #FFFFFF; color: var(--ink); }

.field__control--prefix .field__prefix {
  display: flex;
  align-items: center;
  padding: 0 13px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-light);
  border-right: 1px solid var(--field-border);
}

.field__control--password { padding-right: 4px; }

.field__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  transition: color .15s ease;
}
.field__toggle:hover { color: var(--primary); }
.field__toggle:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

.icon { width: 19px; height: 19px; }
.icon--hidden { display: none !important; }

.field__error {
  min-height: 15px;
  margin: 6px 4px 0;
  font-size: 12px;
  color: var(--red);
}

.field.has-error .field__control {
  border-color: var(--red);
  background: rgba(255,255,255,0.7);
}
.field.has-error .field__control:focus-within {
  box-shadow: 0 0 0 4px rgba(224,71,61,0.16);
}

.field.is-valid .field__control {
  border-color: var(--secondary);
}

/* ---- password strength ---- */

.strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.strength__bar {
  flex: 1;
  height: 5px;
  background: rgba(20,83,45,0.12);
  border-radius: 3px;
  overflow: hidden;
}

.strength__bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--red);
  transition: width .2s ease, background-color .2s ease;
}

.strength__label {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---- checkboxes ---- */

.field__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
  cursor: pointer;
  margin: 20px 0 4px;
  user-select: none;
}

.field__checkbox input {
  margin-top: 3px;
  accent-color: var(--secondary);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---- submit ---- */

.submit-btn {
  width: 100%;
  margin-top: 22px;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--secondary), var(--primary-light));
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 14px 28px -10px rgba(20, 83, 45, 0.55), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: filter .15s ease, transform .12s ease, box-shadow .15s ease;
}
.submit-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 18px 32px -10px rgba(20, 83, 45, 0.6); }
.submit-btn:active { transform: translateY(1px); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.form-status {
  min-height: 18px;
  margin: 14px 2px 0;
  font-size: 13px;
  text-align: center;
}
.form-status.success { color: var(--primary-light); font-weight: 600; }
.form-status.error { color: var(--red); }

.form-foot {
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  margin: 18px 0 0;
}

.form-foot__link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}
.form-foot__link:hover { border-color: var(--primary); }

/* =========================== RESPONSIVE =========================== */

@media (max-width: 560px) {
  .auth-card { padding: 36px 24px 30px; border-radius: 24px; }
  .form-head__title { font-size: 22px; }
  .bubble { display: none; }
  .blob { filter: blur(50px); }
}

@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none !important; }
  * { transition: none !important; }
}