/* 
  auth.css - Premium Authentication Styles for GeckoSMS
*/

:root {
  --brand-green: #67D10D;
  --brand-dark-green: #0D8C3A;
  --brand-navy: #0A1830;
  --bg-light: #F5F7FA;
  --text-main: #334155;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --error: #EF4444;
  --warning: #F59E0B;
}

body {
  margin: 0;
  background-color: var(--bg-light);
  color: var(--text-main);
  overflow-x: hidden;
}

/* =========================================
   Background & Mesh Effects
   ========================================= */

.auth-mesh-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background: var(--brand-navy);
}

.auth-mesh-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  z-index: 1;
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  animation: float-blob 15s ease-in-out infinite alternate;
}

.blob-green {
  width: 400px;
  height: 400px;
  background: var(--brand-green);
  top: -10%;
  right: -10%;
}

.blob-blue {
  width: 500px;
  height: 500px;
  background: #1E3A8A;
  bottom: -20%;
  left: -20%;
  animation-delay: -5s;
}

@keyframes float-blob {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 50px) scale(1.1); }
  100% { transform: translate(-30px, -20px) scale(0.9); }
}

/* Map / Pattern container */
.marketing-visual {
  position: relative;
  z-index: 2;
  margin-top: 2rem;
  opacity: 0.8;
  transition: opacity 0.5s ease;
}

/* =========================================
   Glassmorphism & Panels
   ========================================= */

.glass-panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-card {
  background: #FFFFFF;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

/* =========================================
   Forms & Floating Labels
   ========================================= */

.input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-field {
  width: 100%;
  padding: 1.2rem 1rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  background: #F8FAFC;
  font-family: inherit;
  font-size: 1rem;
  color: var(--brand-navy);
  transition: all 0.2s ease;
  outline: none;
}

.input-field:focus, .input-field:not(:placeholder-shown) {
  background: #FFFFFF;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 4px rgba(103, 209, 13, 0.1);
}

.floating-label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.2s ease;
}

.input-field:focus ~ .floating-label,
.input-field:not(:placeholder-shown) ~ .floating-label {
  top: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-green);
}

/* Input error state */
.input-field.error {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}
.input-field.error ~ .floating-label {
  color: var(--error);
}

/* Error message pop */
.error-message {
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 0.25rem;
  display: none;
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Password Strength Meter
   ========================================= */

.password-meter {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
  height: 4px;
}

.meter-bar {
  flex: 1;
  background: var(--border-color);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.strength-text {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  text-align: right;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* Strength States applied via JS */
.strength-weak .meter-bar:nth-child(1) { background: var(--error); }
.strength-fair .meter-bar:nth-child(1), .strength-fair .meter-bar:nth-child(2) { background: var(--warning); }
.strength-good .meter-bar:nth-child(1), .strength-good .meter-bar:nth-child(2), .strength-good .meter-bar:nth-child(3) { background: var(--brand-green); }
.strength-strong .meter-bar { background: var(--brand-dark-green); }

/* =========================================
   Buttons & Micro Interactions
   ========================================= */

.btn-auth {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-auth::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.4s ease-out;
  border-radius: 50%;
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(103, 209, 13, 0.4);
}

.btn-auth:hover::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Google Button Hover */
.btn-google:hover {
  background: #F8FAFC;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Loading Spinner */
.spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid white;
  width: 1rem;
  height: 1rem;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.btn-loading {
  pointer-events: none;
  opacity: 0.9;
}

/* =========================================
   Toggle Password Eye
   ========================================= */

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 2;
}

.toggle-password:hover {
  color: var(--brand-navy);
}

/* =========================================
   Success Animations
   ========================================= */

.success-check {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(103, 209, 13, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-green);
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* =========================================
   Mobile Optimization
   ========================================= */
@media (max-width: 768px) {
  .input-field {
    font-size: 16px !important;
  }
}
