/* ==========================================================
   Anonix auth styles (signup first, reusable for login etc.)
   ========================================================== */

:root {
  --green: #06853A;
  --green-deep: #06311A;
  --green-ink: #04210F;
  --seal: #B3261E;
  --text: #111;
  --muted: #5f6b64;
  --line: #e4e9e6;
  --error: #d32f2f;
  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #046a2e; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Layout ---------- */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 5fr) 6fr;
}

/* ---------- Brand panel ---------- */
.auth-brand {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 40px 48px;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(60% 45% at 75% 80%, rgba(6, 133, 58, 0.5), transparent 70%),
    #04170C;
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 35%, #000 70%, transparent);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.logo-tile {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 7px;
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.logo-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }

.brand-body { margin-top: auto; max-width: 420px; }
.brand-body h2 {
  margin: 0 0 14px;
  font-size: clamp(2.3rem, 3.6vw, 3.3rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.brand-body p {
  margin: 0;
  max-width: 34ch;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
}

.feature-chips { display: none; }

/* ---- Stage: everything inside is sized in em so it scales as one ---- */
.stage {
  position: relative;
  width: 27em;
  max-width: 100%;
  height: 23em;
  margin: 28px 0 22px;
  font-size: 14px;
}

.glass {
  position: absolute;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.1em;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1.5em 3em rgba(0, 0, 0, 0.35);
}

/* Group */
.group-tag {
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.7em 1em 0.7em 0.8em;
}
.avatars { display: flex; }
.avatars i {
  width: 2em;
  height: 2em;
  margin-left: -0.55em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #0b2a18;
  font-style: normal;
  font-size: 0.8em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: #2f5f45;
}
.avatars i:first-child { margin-left: 0; background: #4d7a62; }
.avatars i:nth-child(3) { background: #1f4a33; }
.group-text { display: grid; line-height: 1.25; }
.group-text strong { font-size: 0.85em; font-weight: 600; }
.group-text span { font-size: 0.75em; color: rgba(255, 255, 255, 0.62); }

/* Inbox: the sealed note */
.sealed {
  position: absolute;
  top: 3.2em;
  left: 0;
  width: 17.5em;
  padding-bottom: 1.6em;
}
.sealed-paper {
  position: relative;
  padding: 1.4em 1.4em 2.7em;
  background: #fff;
  color: var(--text);
  border-radius: 0.45em;
  transform: rotate(-2.5deg);
  box-shadow: 0 1.3em 2.8em rgba(0, 0, 0, 0.4);
}
.sealed-back {
  position: absolute;
  inset: 0 0 1.6em 0;
  padding: 0;
  background: #cfe3d6;
  transform: rotate(3deg);
  box-shadow: none;
}
.sealed-meta { font-size: 0.78em; color: var(--muted); }
.sealed-paper p {
  margin: 0.55em 0 0;
  font-size: 1.05em;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.seal {
  position: absolute;
  right: 1.5em;
  bottom: 0;
  width: 4.2em;
  height: 4.2em;
  display: grid;
  place-items: center;
  border-radius: 52% 48% 55% 45% / 48% 54% 46% 52%;
  background: radial-gradient(circle at 35% 30%, #dc4b41, var(--seal) 55%, #8a1812);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.3), 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: rotate(-8deg);
}
.seal span {
  font-weight: 800;
  font-size: 1.5em;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

/* Chat */
.chat {
  right: 0;
  bottom: 0;
  width: 15.5em;
  padding: 0.9em;
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2em;
}
.chat-head strong { font-size: 0.85em; font-weight: 600; }
.chat-head span { font-size: 0.72em; color: rgba(255, 255, 255, 0.55); }
.bubble {
  max-width: 85%;
  padding: 0.5em 0.8em;
  border-radius: 1em;
  font-size: 0.82em;
  line-height: 1.35;
}
.bubble.in { align-self: flex-start; background: rgba(255, 255, 255, 0.13); border-bottom-left-radius: 0.3em; }
.bubble.out { align-self: flex-end; background: var(--green); border-bottom-right-radius: 0.3em; }
.bubble.media {
  display: flex;
  align-items: center;
  gap: 0.5em;
  width: 8.5em;
  height: 4.4em;
  padding: 0 0.9em;
  background: linear-gradient(135deg, #3f7f5b, #12402a);
}
.bubble.media svg { padding: 0.45em; width: 2.2em; height: 2.2em; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.bubble.media span { margin-left: auto; align-self: flex-end; margin-bottom: 0.5em; font-size: 0.85em; }

/* Photos & videos */
.media-stack {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 10em;
  height: 9em;
}
.shot {
  position: absolute;
  width: 6.6em;
  height: 5.6em;
  border: 0.35em solid #fff;
  border-radius: 0.7em;
  box-shadow: 0 1em 2em rgba(0, 0, 0, 0.4);
}
.shot-photo {
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7cc29a, #2f7a52);
  transform: rotate(-7deg);
}
.shot-photo svg { width: 2.6em; height: 2.6em; }
.shot-video {
  top: 1.3em;
  left: 3.1em;
  background: linear-gradient(160deg, #1f5c3b, #0a2c1a);
  transform: rotate(5deg);
}
.shot-video i {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 2.4em;
  height: 2.4em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green);
}
.shot-video i svg { width: 1.2em; height: 1.2em; margin-left: 0.1em; }
.shot-video span {
  position: absolute;
  right: 0.45em;
  bottom: 0.35em;
  font-size: 0.7em;
  font-weight: 600;
}
.media-pill {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
}

.brand-foot { margin-top: auto; color: rgba(255, 255, 255, 0.55); font-size: 0.8rem; }

/* Fit shorter laptop screens: shrink the whole stage, never remove the seal */
@media (max-height: 820px) { .stage { font-size: 12px; margin: 20px 0 16px; } .auth-brand { padding-block: 32px; } }
@media (max-height: 700px) { .stage { font-size: 10.5px; } .brand-body p { display: none; } }

/* One orchestrated moment: cards rise in turn, then the seal presses */
@media (prefers-reduced-motion: no-preference) {
  .sealed, .glass, .media-stack { animation: rise 0.7s cubic-bezier(.2, .8, .2, 1) both; }
  .group-tag { animation-delay: 0.15s; }
  .chat { animation-delay: 0.3s; }
  .media-stack { animation-delay: 0.45s; }
  .seal { animation: press 0.6s 0.7s cubic-bezier(.2, 1.4, .4, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(1.2em); } to { opacity: 1; transform: none; } }
  @keyframes press {
    from { transform: rotate(-8deg) scale(1.7); opacity: 0; }
    to   { transform: rotate(-8deg) scale(1);   opacity: 1; }
  }
}

/* ---------- Form panel ---------- */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card { width: 100%; max-width: 400px; }

.mobile-lockup { display: none; }

.auth-head h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.auth-head p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.field { margin-bottom: 18px; }

/* ---------- Inputs (unchanged style) ---------- */
.floating-input-content {
  width: 100%;
  position: relative;
}

.floating-input {
  font-size: 14px;
  font-family: inherit;
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  caret-color: #06853A;
  background: white;
  color: black;
  border: 1px solid #06853A;
  border-radius: 10px;
  box-sizing: border-box;

  &:focus {
    outline: none;
    border: 2px solid #06853A;

    ~.floating-label {
      top: -8px;
      font-size: 13px;
      color: #06853A;
    }
  }
}

.floating-input:not(:placeholder-shown)~.floating-label {
  top: -8px;
  font-size: 13px;
}

.floating-input-error {
  font-size: 14px;
  font-family: inherit;
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  caret-color: #06853A;
  background: white;
  color: black;
  border: 1px solid red;
  border-radius: 10px;
  box-sizing: border-box;

  &:focus {
    outline: none;
    border: 2px solid red;

    ~.floating-label {
      top: -8px;
      font-size: 13px;
      color: red;
    }
  }
}

.floating-input-error:not(:placeholder-shown)~.floating-label {
  top: -8px;
  font-size: 13px;
}

.floating-label {
  color: black;
  font-size: 13px;
  font-weight: normal;
  position: absolute;
  pointer-events: none;
  left: 14px;
  top: 12px;
  padding: 0 5px;
  background: white;
  transition: 0.2s ease all;
  -moz-transition: 0.2s ease all;
  -webkit-transition: 0.2s ease all;
}

.eye-icon {
  position: absolute;
  right: 6px;
  width: 25px;
  height: 25px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

/* ---------- Errors, suggestions, rules ---------- */
.field-error {
  display: block;
  margin-top: 6px;
  color: var(--error);
  font-size: 0.8rem;
  line-height: 1.4;
}

.suggestions { margin-top: 10px; }
.suggestions small { color: var(--muted); font-size: 0.8rem; }
.suggestions small span { color: #8a958e; }
.suggestion-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.suggestion {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef6f1;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.suggestion:hover { background: #dcefe3; }

.rules {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.rules li {
  position: relative;
  padding-left: 20px;
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.15s;
}
.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  border: 1.5px solid #c3ccc6;
  transition: background 0.15s, border-color 0.15s;
}
.rules li.ok { color: var(--green); }
.rules li.ok::before {
  border-color: var(--green);
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

/* ---------- Button & footer text ---------- */
.verify {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.verify:hover:not(:disabled) { background: #057535; }
.verify:active:not(:disabled) { transform: scale(0.985); }

button:disabled { cursor: not-allowed; opacity: 0.5; }

.legal {
  margin: 14px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.switch {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}
.switch a { font-weight: 600; }

.field-error.is-warning { color: var(--muted); }
.form-row { display: flex; justify-content: flex-end; margin-top: -6px; }
.forgot { font-size: 0.85rem; font-weight: 500; }

.resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  background: none;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green);
  cursor: pointer;
}
.resend svg { width: 18px; height: 18px; }
.resend:hover:not(:disabled) { background: #eef6f1; }
.resend:disabled { color: var(--muted); cursor: not-allowed; opacity: 1; }
.notice { margin: 6px 0 0; font-size: 0.82rem; color: var(--green); text-align: center; }

.verify-link, .verify-link:hover { color: #fff; text-align: center; text-decoration: none; }
.verify-link:hover { background: #057535; }

/* ---------- Preloader & alerts (used by sign_up-login.js) ---------- */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: #000000;
  z-index: 10000;
  animation: loading 2s linear infinite;
}
@keyframes loading {
  0% { width: 0; }
  100% { width: 100%; }
}
.preloader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  justify-content: center;
  align-items: center;
  display: none;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}
.password-mismatch-alert,
.error-alert {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  background-color: black;
  width: 90%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 15px;
  padding: 5px;
  text-align: center;
  border-radius: 20px;
  display: none;
  z-index: 99999;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { align-items: flex-start; padding: 32px 20px 40px; }

  .mobile-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
  }
  .mobile-lockup .logo-tile { box-shadow: none; border: 1px solid var(--line); }

  .feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: -12px 0 24px;
    padding: 0;
  }
  .feature-chips li {
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef6f1;
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 500;
  }
}