/* =============================================
   SMS WispHub — Auth / Login Styles
   ============================================= */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}

/* ── Background ─────────────────────────────── */
.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Animated blobs */
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.auth-blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #667eea, transparent);
  top: -150px;
  left: -100px;
  animation: blobFloat1 12s ease-in-out infinite;
}

.auth-blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #764ba2, transparent);
  bottom: -100px;
  right: -80px;
  animation: blobFloat2 15s ease-in-out infinite;
}

.auth-blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #4facfe, transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: blobFloat3 10s ease-in-out infinite;
}

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, 30px) scale(1.05); }
  66%       { transform: translate(-20px, 50px) scale(0.98); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(-50px, -30px) scale(1.08); }
  70%       { transform: translate(30px, -50px) scale(0.95); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.25; }
  50%       { transform: translate(-50%, -55%) scale(1.1); opacity: 0.15; }
}

/* Floating icons in background */
.auth-icons-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.float-icon {
  position: absolute;
  color: rgba(255,255,255,0.04);
  font-size: 40px;
  animation: floatIcon linear infinite;
}

@keyframes floatIcon {
  from { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  to   { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ── Login Card ─────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 48px 44px;
  position: relative;
  z-index: 10;
  animation: cardEntrance .6s cubic-bezier(.34,1.56,.64,1);
  box-shadow:
    0 32px 80px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

@keyframes cardEntrance {
  from { opacity: 0; transform: scale(.88) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Brand / Logo ───────────────────────────── */
.login-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  font-size: 28px;
  color: #fff;
  box-shadow: 0 8px 28px rgba(102,126,234,0.5);
  animation: logoPulse 2.5s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(102,126,234,0.5); }
  50%       { box-shadow: 0 8px 40px rgba(102,126,234,0.8), 0 0 0 12px rgba(102,126,234,0.06); }
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 13.5px;
  margin: 0 0 36px;
}

/* ── Form Fields ────────────────────────────── */
.auth-field {
  position: relative;
  margin-bottom: 18px;
}

.auth-field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 15px;
  pointer-events: none;
  transition: color .25s;
  z-index: 2;
}

.auth-field-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  transition: color .25s;
  z-index: 2;
}

.auth-field-toggle:hover { color: rgba(255,255,255,0.8); }

.auth-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px 46px 14px 46px;
  color: #fff;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: all .25s;
}

.auth-input::placeholder { color: rgba(255,255,255,0.3); }

.auth-input:focus {
  border-color: rgba(102,126,234,0.7);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.18);
}

.auth-input:focus + .auth-field-icon,
.auth-field:focus-within .auth-field-icon {
  color: #667eea;
}

/* Autofill override */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(30,25,60,0.95) inset;
  -webkit-text-fill-color: #fff;
  border-color: rgba(102,126,234,0.5);
}

/* ── Remember Me ────────────────────────────── */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  cursor: pointer;
  user-select: none;
}

.auth-remember input[type=checkbox] {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  accent-color: #667eea;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-remember span {
  color: rgba(255,255,255,0.6);
  font-size: 13.5px;
}

/* ── Submit Button ──────────────────────────── */
.btn-login {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .3s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(102,126,234,0.4);
  letter-spacing: .3px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(102,126,234,0.55);
}

.btn-login:active { transform: translateY(0); }

.btn-login:disabled {
  opacity: .75;
  cursor: not-allowed;
  transform: none;
}

.btn-login .btn-text,
.btn-login .btn-loading { transition: opacity .2s; }
.btn-login .btn-loading  { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; }
.btn-login.loading .btn-text    { opacity: 0; }
.btn-login.loading .btn-loading { opacity: 1; }

/* ── Ripple on button ───────────────────────── */
.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .3s;
}
.btn-login:hover::before { background: rgba(255,255,255,0.06); }

/* ── Error / Success Alerts ─────────────────── */
.auth-alert {
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  border: 1px solid;
  animation: alertIn .35s cubic-bezier(.34,1.56,.64,1);
}

@keyframes alertIn {
  from { opacity: 0; transform: scale(.94) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-alert-error {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

.auth-alert-success {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.3);
  color: #6ee7b7;
}

.auth-alert-locked {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.3);
  color: #fcd34d;
}

/* Shake for wrong password */
.shake {
  animation: shake .5s cubic-bezier(.36,.07,.19,.97);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  30%       { transform: translateX(8px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  75%       { transform: translateX(-4px); }
  90%       { transform: translateX(4px); }
}

/* ── Divider ────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.auth-divider span {
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  white-space: nowrap;
}

/* ── Footer ─────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 32px;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
}

.auth-footer strong { color: rgba(255,255,255,0.45); }

/* ── Credentials hint (dev only) ────────────── */
.auth-hint {
  background: rgba(102,126,234,0.08);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-align: center;
}

.auth-hint strong { color: rgba(102,126,234,0.9); }

/* ── Version badge ──────────────────────────── */
.version-badge {
  position: fixed;
  bottom: 14px;
  right: 16px;
  color: rgba(255,255,255,0.2);
  font-size: 11px;
  z-index: 20;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 480px) {
  .login-card {
    padding: 36px 28px;
    border-radius: 20px;
  }
  .login-title  { font-size: 22px; }
  .auth-input   { padding: 13px 44px 13px 44px; font-size: 14px; }
  .btn-login    { padding: 14px; font-size: 14.5px; }
}

@media (max-width: 360px) {
  .login-card { padding: 28px 20px; }
}

/* ── Scrollbar on login page ────────────────── */
body::-webkit-scrollbar { width: 6px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
