/* ===========================
   AI Guardian — Sign Up
   White theme, red/pink brand
=========================== */

:root{
  --white: #ffffff;
  --bg: #fff9fa;
  --rose-50: #fff1f4;
  --rose-100: #ffe3e9;
  --rose-200: #ffc9d6;

  --pink-500: #ff4d6d;
  --pink-600: #f5365f;
  --red-600: #e11d48;
  --red-700: #be123c;

  --ink-900: #23131b;
  --ink-700: #4a2f3a;
  --ink-500: #8a6a76;
  --ink-400: #b79aa4;

  --border: #ffd9e2;
  --shadow-brand: rgba(225, 29, 72, 0.16);
  --shadow-soft: rgba(76, 20, 40, 0.08);

  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*, *::before, *::after{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body{
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page{
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 32px;
  overflow-x: hidden;
}

/* Ambient background glow — signature touch, kept quiet */
.glow{
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.glow--one{
  width: 480px;
  height: 480px;
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, var(--rose-200), transparent 70%);
}
.glow--two{
  width: 420px;
  height: 420px;
  bottom: -160px;
  right: -120px;
  background: radial-gradient(circle, var(--rose-100), transparent 70%);
}

/* ===== Card ===== */
.auth-card{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 38px 34px;
  box-shadow:
    0 1px 2px var(--shadow-soft),
    0 24px 48px -20px var(--shadow-brand);
}

.auth-header{
  text-align: center;
  margin-bottom: 28px;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.brand__mark{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--pink-500), var(--red-600));
  box-shadow: 0 6px 16px -4px var(--shadow-brand);
}

.brand__name{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--ink-900);
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--rose-50);
  border: 1px solid var(--rose-200);
  color: var(--red-700);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-title{
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink-900);
}

.auth-subtitle{
  margin: 0 auto;
  max-width: 340px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-500);
}

/* ===== Form ===== */
.auth-form{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field{
  display: flex;
  flex-direction: column;
  gap: 7px;
}

label{
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-700);
}

.req{ color: var(--red-600); }
.optional{ color: var(--ink-400); font-weight: 500; }

.input-wrap{
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon{
  position: absolute;
  left: 14px;
  color: var(--ink-400);
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"]{
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--rose-50);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder{
  color: var(--ink-400);
}

input:hover{
  border-color: var(--rose-200);
}

input:focus{
  background: var(--white);
  border-color: var(--pink-500);
  box-shadow: 0 0 0 4px var(--rose-100);
}

.field.has-error input{
  border-color: var(--red-600);
  background: #fff5f6;
}

.field.has-error input:focus{
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.14);
}

.toggle-visibility{
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--ink-400);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.toggle-visibility:hover{
  color: var(--red-600);
  background: var(--rose-100);
}

.hint{
  margin: 0;
  font-size: 12px;
  color: var(--ink-400);
}

.error{
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--red-600);
  min-height: 0;
  display: none;
}
.error.visible{ display: block; }

/* Password strength meter */
.strength-meter{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 2px;
}
.strength-meter span{
  height: 4px;
  border-radius: 999px;
  background: var(--rose-100);
  transition: background 0.2s ease;
}
.strength-meter[data-level="1"] span:nth-child(1){ background: var(--red-600); }
.strength-meter[data-level="2"] span:nth-child(-n+2){ background: #ff8a3d; }
.strength-meter[data-level="3"] span:nth-child(-n+3){ background: #ffb020; }
.strength-meter[data-level="4"] span:nth-child(-n+4){ background: #19b36b; }

/* Checkbox */
.checkbox-row{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-top: 2px;
}

.checkbox-row input[type="checkbox"]{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.checkbox-box{
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--rose-50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.checkbox-box svg{
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.checkbox-row input:checked + .checkbox-box{
  background: linear-gradient(135deg, var(--pink-500), var(--red-600));
  border-color: transparent;
}
.checkbox-row input:checked + .checkbox-box svg{
  opacity: 1;
  transform: scale(1);
}

.checkbox-row input:focus-visible + .checkbox-box{
  box-shadow: 0 0 0 4px var(--rose-100);
}

.checkbox-text{
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-500);
}
.checkbox-text a{
  color: var(--red-600);
  font-weight: 600;
  text-decoration: none;
}
.checkbox-text a:hover{ text-decoration: underline; }

#termsError{ margin-top: -10px; }

/* Submit */
.submit-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-500), var(--red-600));
  color: var(--white);
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px -10px var(--shadow-brand);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.submit-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -10px var(--shadow-brand);
  filter: brightness(1.03);
}
.submit-btn:active{
  transform: translateY(0);
}
.submit-btn:disabled{
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.submit-btn svg{ transition: transform 0.15s ease; }
.submit-btn:hover svg{ transform: translateX(3px); }

.submit-btn--ghost{
  background: var(--rose-50);
  color: var(--red-700);
  box-shadow: none;
  border: 1.5px solid var(--border);
}
.submit-btn--ghost:hover{
  background: var(--rose-100);
  filter: none;
}

.signin-row{
  text-align: center;
  margin: 12px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-500);
}
.signin-row a{
  color: var(--red-600);
  font-weight: 700;
  text-decoration: none;
}
.signin-row a:hover{ text-decoration: underline; }

/* ===== Success panel ===== */
.success-panel{
  text-align: center;
  padding: 12px 6px 4px;
  animation: fadeUp 0.4s ease;
}

.success-icon{
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-500), var(--red-600));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px -10px var(--shadow-brand);
}

.success-panel h2{
  font-family: var(--font-display);
  font-size: 21px;
  margin: 0 0 10px;
  color: var(--ink-900);
}

.success-panel p{
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-500);
  max-width: 320px;
  margin: 0 auto 24px;
}

@keyframes fadeUp{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}

.footnote{
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 20px auto 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-400);
  padding: 0 12px;
}

/* Shake animation for validation errors */
.shake{
  animation: shake 0.32s ease;
}
@keyframes shake{
  0%, 100%{ transform: translateX(0); }
  25%{ transform: translateX(-6px); }
  75%{ transform: translateX(6px); }
}

/* ===== Responsive ===== */
@media (max-width: 480px){
  .auth-card{
    padding: 30px 22px 26px;
    border-radius: 18px;
  }
  .auth-title{ font-size: 22px; }
  .field-row{
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .brand__name{ font-size: 17px; }
}

@media (min-width: 481px) and (max-width: 700px){
  .auth-card{ padding: 36px 30px 30px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Visible keyboard focus for interactive elements without their own ring */
a:focus-visible,
button:focus-visible{
  outline: 2px solid var(--red-600);
  outline-offset: 2px;
  border-radius: 6px;
}
