/* ============================================================
   Fibi CPaaS — Auth Stylesheet
   Theme: Dark #0c0d12 · Pink #ed0d92 · Font: Poppins
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── Auth Screen ─────────────────────────────────────────── */
#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0d12;
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 5000;
  font-family: 'Poppins', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated background ─────────────────────────────────── */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 48px 48px;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: orb-float 22s ease-in-out infinite alternate;
}
.auth-orb-1 {
  width: 650px; height: 650px;
  background: radial-gradient(circle, rgba(237,13,146,.28) 0%, transparent 70%);
  top: -25%; left: -18%;
  animation-duration: 28s;
}
.auth-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(147,51,234,.22) 0%, transparent 70%);
  bottom: -18%; right: -12%;
  animation-duration: 22s;
  animation-delay: -10s;
}
.auth-orb-3 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(237,13,146,.12) 0%, transparent 70%);
  top: 42%; left: 52%;
  animation-duration: 32s;
  animation-delay: -18s;
}

@keyframes orb-float {
  0%   { transform: translate(0,0) scale(1); }
  33%  { transform: translate(50px,-35px) scale(1.04); }
  66%  { transform: translate(-30px,25px) scale(.97); }
  100% { transform: translate(25px,45px) scale(1.02); }
}

/* ── Panel ───────────────────────────────────────────────── */
.auth-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  animation: auth-enter .4s cubic-bezier(.16,1,.3,1);
}

@keyframes auth-enter {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo ────────────────────────────────────────────────── */
.auth-logo-wrap {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.auth-logo-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #ed0d92 0%, #9333ea 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px rgba(237,13,146,.38), 0 2px 8px rgba(0,0,0,.5);
  flex-shrink: 0;
}

.auth-logo-text { display: flex; flex-direction: column; }

.auth-brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.025em;
  background: linear-gradient(135deg, #ed0d92 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.auth-tagline {
  font-size: .67rem;
  color: #3d3f52;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Card ────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  background: rgba(20, 21, 30, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 20px;
  padding: 2rem 1.875rem;
  box-shadow:
    0 0 0 1px rgba(237,13,146,.06) inset,
    0 28px 70px rgba(0,0,0,.7),
    0 0 80px rgba(237,13,146,.04);
}

.auth-card-header { margin-bottom: 1.4rem; }

.auth-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #f0f1f5;
  margin-bottom: .35rem;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: .82rem;
  color: #505265;
  line-height: 1.5;
}

/* ── Tabs ────────────────────────────────────────────────── */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 1.4rem;
  position: relative;
}

.auth-tab {
  padding: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: #505265;
  border-radius: 7px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color .2s;
  position: relative;
  z-index: 1;
  font-family: inherit;
  letter-spacing: -.01em;
}
.auth-tab.active { color: #f0f1f5; }

.auth-tab-indicator {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 7px;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

/* ── Form ────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: .95rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: .38rem;
}

.auth-label-row {
  display: flex; align-items: center; justify-content: space-between;
}

.auth-label {
  font-size: .72rem;
  font-weight: 600;
  color: #9496a8;
  letter-spacing: .015em;
}

.auth-optional { font-weight: 400; color: #3d3f52; }

.auth-slug-preview {
  font-size: .68rem;
  color: #9333ea;
  font-weight: 500;
  margin-left: .35rem;
}

.auth-hint {
  font-size: .67rem;
  color: #3d3f52;
  line-height: 1.4;
}

/* ── Inputs ──────────────────────────────────────────────── */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: .8rem;
  color: #3d3f52;
  display: flex; align-items: center;
  pointer-events: none;
  transition: color .2s;
  z-index: 1;
}

.auth-input {
  width: 100%;
  background: rgba(255,255,255,.035);
  border: 1.5px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: .68rem .85rem .68rem 2.6rem;
  font-size: .875rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 400;
  color: #f0f1f5;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-font-smoothing: antialiased;
}
.auth-input::placeholder { color: #2a2c3a; }
.auth-input:focus {
  border-color: rgba(237,13,146,.55);
  background: rgba(237,13,146,.04);
  box-shadow: 0 0 0 3px rgba(237,13,146,.12);
}
.auth-input-wrap:focus-within .auth-input-icon { color: #ed0d92; }

/* Input without icon */
.auth-input.no-icon { padding-left: .85rem; }

.auth-eye-btn {
  position: absolute; right: .7rem;
  color: #3d3f52;
  display: flex; align-items: center; justify-content: center;
  padding: .3rem;
  border: none; background: none; cursor: pointer;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.auth-eye-btn:hover { color: #9496a8; background: rgba(255,255,255,.05); }

/* ── Options ─────────────────────────────────────────────── */
.auth-options {
  display: flex; align-items: center; justify-content: space-between;
}

.auth-remember {
  display: flex; align-items: center; gap: .5rem;
  font-size: .775rem; color: #505265;
  cursor: pointer; user-select: none;
}

.auth-checkbox { display: none; }

.auth-check-box {
  width: 17px; height: 17px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.auth-checkbox:checked + .auth-check-box {
  background: linear-gradient(135deg, #ed0d92, #9333ea);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(237,13,146,.35);
}
.auth-checkbox:checked + .auth-check-box::after {
  content: '';
  display: block;
  width: 9px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px,-1px);
}

.auth-forgot-link {
  font-size: .75rem;
  font-weight: 600;
  color: #ed0d92;
  background: none; border: none;
  cursor: pointer; padding: 0;
  font-family: inherit;
  transition: color .2s, opacity .2s;
}
.auth-forgot-link:hover { opacity: .75; }

/* ── Primary CTA button ──────────────────────────────────── */
.auth-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  padding: .82rem 1.5rem;
  background: linear-gradient(135deg, #ed0d92 0%, #9333ea 100%);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  font-family: 'Poppins', inherit;
  letter-spacing: -.01em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow:
    0 4px 22px rgba(237,13,146,.38),
    0 1px 4px rgba(0,0,0,.4);
  position: relative;
  overflow: hidden;
  margin-top: .2rem;
}
.auth-btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.14) 0%, transparent 60%);
  pointer-events: none;
}
.auth-btn-primary:hover:not(:disabled) {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(237,13,146,.48), 0 2px 8px rgba(0,0,0,.4);
}
.auth-btn-primary:active:not(:disabled) { transform: translateY(0); }
.auth-btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.auth-btn-text   { line-height: 1; position: relative; z-index: 1; }
.auth-btn-loader { display: flex; align-items: center; position: relative; z-index: 1; }

/* ── Error ───────────────────────────────────────────────── */
.auth-error {
  display: flex; align-items: center; gap: .55rem;
  padding: .65rem .875rem;
  background: rgba(239,68,68,.09);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 8px;
  font-size: .775rem;
  color: #fca5a5;
  line-height: 1.4;
}
.auth-error::before { content: '⚠'; flex-shrink: 0; }

/* ── Terms ───────────────────────────────────────────────── */
.auth-terms {
  font-size: .7rem; color: #3d3f52;
  text-align: center; line-height: 1.5;
}
.auth-link {
  color: #9333ea; text-decoration: none;
  transition: color .2s;
}
.auth-link:hover { color: #a855f7; }
.auth-link-btn {
  background: none; border: none; padding: 0;
  color: #9333ea; font: inherit; font-size: inherit;
  cursor: pointer; transition: color .2s;
}
.auth-link-btn:hover { color: #a855f7; }

/* ── Password strength ───────────────────────────────────── */
.pw-strength-wrap {
  display: flex; align-items: center; gap: .55rem; margin-top: .2rem;
}
.pw-strength-bar {
  flex: 1; height: 3px;
  background: rgba(255,255,255,.06);
  border-radius: 2px; overflow: hidden;
}
.pw-strength-fill {
  height: 100%; border-radius: 2px;
  transition: width .3s ease, background .3s ease;
  width: 0%;
}
.pw-strength-label { font-size: .67rem; font-weight: 700; min-width: 68px; }

/* ── Back button ─────────────────────────────────────────── */
.auth-back-row { margin-bottom: 1.1rem; }
.auth-back-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  color: #505265; font-size: .775rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  padding: .25rem 0; transition: color .2s; font-family: inherit;
}
.auth-back-btn:hover { color: #9496a8; }

/* ── Icon badge ──────────────────────────────────────────── */
.auth-icon-badge {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(237,13,146,.1);
  border: 1px solid rgba(237,13,146,.18);
  display: flex; align-items: center; justify-content: center;
  color: #ed0d92;
  margin-bottom: .875rem;
}

/* ── Success / Error state ───────────────────────────────── */
.auth-success-state { text-align: center; padding: .5rem 0; }

.auth-success-icon {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.2);
  display: flex; align-items: center; justify-content: center;
  color: #4ade80;
  margin: 0 auto 1.1rem;
}
.auth-success-icon.error {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.2);
  color: #f87171;
}

.auth-resend {
  margin-top: .875rem; font-size: .775rem; color: #3d3f52;
}

/* ── Footer ──────────────────────────────────────────────── */
.auth-footer {
  display: flex; align-items: center; gap: .55rem;
  font-size: .7rem; color: #2a2c3a;
}
.auth-footer-link {
  color: #3d3f52; text-decoration: none;
  display: flex; align-items: center; gap: .3rem;
  transition: color .2s;
}
.auth-footer-link:hover { color: #9496a8; }
.auth-footer-sep { color: #1e1f28; }

/* ── Spinner ─────────────────────────────────────────────── */
.spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
  #auth-screen { padding: 1rem .75rem; align-items: flex-start; padding-top: 1.5rem; }
  .auth-card   { padding: 1.5rem 1.25rem; border-radius: 16px; }
  .auth-panel  { gap: 1.1rem; }
  .form-row-2  { grid-template-columns: 1fr; }
  .auth-title  { font-size: 1.25rem; }
}

@media (max-width: 360px) {
  .auth-card { padding: 1.25rem 1rem; }
}

/* ── Focus rings ─────────────────────────────────────────── */
.auth-input:focus-visible      { outline: none; }
.auth-btn-primary:focus-visible { outline: 2px solid rgba(237,13,146,.7); outline-offset: 2px; }
.auth-tab:focus-visible        { outline: 2px solid rgba(237,13,146,.5); outline-offset: 1px; }
