/* ─────────────────────────────────────────────────────────
   Stratamize CRM — Login Page
   Animated orbital rings · particles · Google + SMS auth
   ───────────────────────────────────────────────────────── */

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #080c10;
  min-height: 100vh;
  overflow: hidden;
}

/* ─── Particles ──────────────────────────────────────────── */
#particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #050810 0%, #0d1620 50%, #080c14 100%);
}

/* ─── Layout ─────────────────────────────────────────────── */
.login-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ─── Left panel ─────────────────────────────────────────── */
.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
}

.login-left::after {
  content: '';
  position: absolute;
  top: 10%; right: 0;
  width: 1px; height: 80%;
  background: linear-gradient(to bottom, transparent, rgba(29,158,117,.35), transparent);
}

.info-panel { max-width: 440px; width: 100%; }

/* Brand header */
.brand-header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 56px;
}

/* ─── Animated orbital rings logo ────────────────────────── */
.logo-shape {
  width: 82px; height: 82px;
  flex-shrink: 0;
  transform-style: preserve-3d;
}

.logo-shape svg {
  width: 100%; height: 100%;
  transform-style: preserve-3d;
}

/* Base ring */
.ring {
  fill: none;
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-dasharray: 2 6;
  transform-box: fill-box;
  transform-origin: center center;
}

/* Teal gradient rings (1 & 3) */
.ring1, .ring3 {
  stroke: url(#tealGrad);
  filter: drop-shadow(0 0 5px rgba(29,158,117,.7));
}

/* Deeper teal rings (2 & 4) */
.ring2, .ring4 {
  stroke: #0F6E56;
  filter: drop-shadow(0 0 3px rgba(15,110,86,.5));
}

/* Ring 1: tilt X, spin Z forward 8s */
.ring1 {
  transform: rotateX(60deg);
  animation: spin1 8s linear infinite, dash1 0.6s linear infinite;
}
@keyframes spin1 { to { transform: rotateX(60deg) rotateZ(360deg); } }
@keyframes dash1 { to { stroke-dashoffset: -10; } }

/* Ring 2: tilt Y, spin Z reverse 6s */
.ring2 {
  transform: rotateY(60deg);
  animation: spin2 6s linear infinite reverse, dash2 0.5s linear infinite reverse;
}
@keyframes spin2 { to { transform: rotateY(60deg) rotateZ(-360deg); } }
@keyframes dash2 { to { stroke-dashoffset: 10; } }

/* Ring 3: tilt Z+X, spin Y 5s */
.ring3 {
  transform: rotateZ(60deg) rotateX(30deg);
  animation: spin3 5s linear infinite, dash3 0.7s linear infinite;
}
@keyframes spin3 { to { transform: rotateZ(60deg) rotateX(30deg) rotateY(360deg); } }
@keyframes dash3 { to { stroke-dashoffset: -10; } }

/* Ring 4: tilt Y+X, spin Z 7s */
.ring4 {
  transform: rotateY(-45deg) rotateX(30deg);
  animation: spin4 7s linear infinite, dash4 0.4s linear infinite;
}
@keyframes spin4 { to { transform: rotateY(-45deg) rotateX(30deg) rotateZ(360deg); } }
@keyframes dash4 { to { stroke-dashoffset: 10; } }

/* Brand text */
.brand-text h2 {
  font-size: 22px;
  font-weight: 800;
  color: #e6edf3;
  letter-spacing: -.02em;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #adbac7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tagline {
  font-size: 12px;
  color: rgba(255,255,255,.38);
  margin-top: 4px;
  letter-spacing: .01em;
  -webkit-text-fill-color: rgba(255,255,255,.38);
}

/* Feature list */
.feature-list { display: flex; flex-direction: column; gap: 22px; }

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(230,237,243,.7);
}

.feature-icon {
  width: 38px; height: 38px;
  background: rgba(29,158,117,.1);
  border: 1px solid rgba(29,158,117,.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #1D9E75;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}
.feature-item:hover .feature-icon {
  background: rgba(29,158,117,.18);
  border-color: rgba(29,158,117,.4);
}

/* ─── Right panel ────────────────────────────────────────── */
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  max-width: 520px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 25px 60px rgba(0,0,0,.5);
  padding: 40px 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Card header */
.login-card-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-card-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: -.02em;
}
.login-card-header p {
  font-size: 13px;
  color: rgba(255,255,255,.38);
  margin-top: 5px;
}

/* Messages */
#msg-container { margin-bottom: 4px; }
.login-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.28);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.5;
}
.login-success {
  background: rgba(29,158,117,.12);
  border: 1px solid rgba(29,158,117,.3);
  color: #34d399;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

/* ─── Google button ──────────────────────────────────────── */
.btn-google {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 4px;
  font-family: inherit;
}
.btn-google:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.24);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
}
.btn-google:active { transform: translateY(0); }

/* ─── Divider ────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: rgba(255,255,255,.25);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.08);
}

/* ─── Form elements ──────────────────────────────────────── */
.login-form, #phone-form, #code-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(230,237,243,.5);
  letter-spacing: .05em;
  text-transform: uppercase;
}

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

.input-icon {
  position: absolute;
  left: 13px;
  color: rgba(255,255,255,.28);
  pointer-events: none;
  flex-shrink: 0;
}

.input-wrap input {
  width: 100%;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 12px 42px 12px 40px;
  font-size: 14px;
  font-family: inherit;
  color: #e6edf3;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.input-wrap input::placeholder { color: rgba(255,255,255,.2); }
.input-wrap input:focus {
  border-color: rgba(29,158,117,.7);
  background: rgba(29,158,117,.07);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

.toggle-pw {
  position: absolute;
  right: 11px;
  background: none; border: none;
  cursor: pointer; color: rgba(255,255,255,.28);
  padding: 5px;
  transition: color .15s;
  display: flex; align-items: center;
}
.toggle-pw:hover { color: rgba(255,255,255,.6); }

/* ─── Primary button ─────────────────────────────────────── */
.btn-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1D9E75 0%, #0e6e52 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: .01em;
  box-shadow: 0 4px 20px rgba(29,158,117,.35), inset 0 1px 0 rgba(255,255,255,.08);
  transition: opacity .15s, transform .1s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.btn-signin::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent);
}
.btn-signin:hover:not(:disabled) {
  opacity: .93;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(29,158,117,.5);
}
.btn-signin:active  { transform: translateY(0); }
.btn-signin:disabled { opacity: .55; cursor: not-allowed; }

/* Back button */
.btn-back {
  background: none; border: none;
  color: rgba(255,255,255,.35);
  font-size: 13px; font-family: inherit;
  cursor: pointer; text-align: center;
  padding: 4px 0;
  transition: color .15s;
}
.btn-back:hover { color: rgba(255,255,255,.65); }

/* ─── Spinner ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spinnerRot .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spinnerRot { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ─── Footer ─────────────────────────────────────────────── */
.login-footer {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,.17);
  margin-top: 28px;
  letter-spacing: .02em;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  body { overflow: auto; }
  .login-wrapper { flex-direction: column; }
  .login-left { display: none; }
  .login-right {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    padding: 40px 20px;
    justify-content: flex-start;
    padding-top: 60px;
  }
  .login-card { padding: 32px 24px; }
}
