/* ═══════════════════════════════════════════════════════════
   Polygott Auth — Login / Register Styles
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a1a;
  --bg-card: rgba(20, 20, 45, 0.85);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0ff;
  --text-secondary: #8888aa;
  --text-muted: #5a5a7a;
  --accent: #2E86C1;
  --accent-hover: #47A5DB;
  --accent-glow: rgba(46, 134, 193, 0.3);
  --danger: #FF6584;
  --success: #43B581;
  --warning: #FAA61A;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(46, 134, 193, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ── Animated Background ── */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(46, 134, 193, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(71, 165, 219, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(67, 181, 129, 0.08) 0%, transparent 50%);
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.7; transform: scale(1); }
}

/* ── Container ── */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ── Brand ── */
.brand {
  text-align: center;
  margin-bottom: 8px;
}

.brand-globe {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  animation: iconFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 16px rgba(46, 134, 193, 0.35));
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.brand-name {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #2E86C1;
}

.brand-tagline {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* ── Auth Card ── */
.auth-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  position: relative;
}

.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: var(--transition);
}

.auth-tab.active {
  color: var(--text-primary);
}

.auth-tab.active::after {
  transform: scaleX(1);
}

.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.auth-tab .material-icons-round {
  font-size: 20px;
}

/* ── Forms ── */
.auth-form {
  padding: 28px 28px 24px;
  display: none;
  flex-direction: column;
  gap: 18px;
}

.auth-form.active {
  display: flex;
}

/* ── Input Groups ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.input-wrap input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrap input:focus + .input-icon,
.input-wrap input:focus ~ .input-icon {
  color: var(--accent);
}

/* ── Toggle Password ── */
.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--text-secondary);
}

.toggle-password .material-icons-round {
  font-size: 20px;
}

/* ── Password Strength ── */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: var(--transition);
}

.password-strength.visible {
  opacity: 1;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.strength-text {
  font-size: 12px;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

/* ── Error Message ── */
.error-msg {
  padding: 10px 14px;
  background: rgba(255, 101, 132, 0.1);
  border: 1px solid rgba(255, 101, 132, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: shakeIn 0.4s;
}

.error-msg.hidden {
  display: none;
}

@keyframes shakeIn {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* ── Buttons ── */
.btn-primary {
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--accent), #47A5DB);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary .material-icons-round {
  font-size: 20px;
}

.btn-submit {
  margin-top: 4px;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-spinner.hidden { display: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

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

/* ── Guest Button ── */
.btn-guest {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-guest:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-guest .material-icons-round {
  font-size: 20px;
}

/* ── Footer ── */
.auth-footer {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-container {
    padding: 16px;
  }
  .auth-form {
    padding: 20px 20px 18px;
  }
  .brand-name {
    font-size: 28px;
  }
  .brand-globe {
    width: 60px;
    height: 60px;
  }
}
