@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Plus+Jakarta+Sans:wght@400;500;700&display=swap');

:root {
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.5);
  --secondary: #06b6d4;
  --bg-black: #020617;
  --text-pure: #ffffff;
  --text-silver: #cbd5e1;
  --text-dim: #64748b;
  --glass: rgba(15, 23, 42, 0.7);
  --border: rgba(255, 255, 255, 0.08);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-black);
  color: var(--text-pure);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: radial-gradient(circle at 10% 10%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 20px;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-box {
  background: var(--glass);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 50px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.login-header h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.error-banner {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  animation: slideIn 0.3s ease-out;
}

.error-banner svg {
  color: #f43f5e;
  flex-shrink: 0;
}

.error-text {
  color: #fda4af;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-silver);
}

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

.forgot-link {
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.input-wrapper svg {
  margin-left: 16px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.input-wrapper input {
  width: 100%;
  background: none;
  border: none;
  padding: 14px 44px 14px 12px;
  color: #fff !important;
  caret-color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-silver);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0.7;
  transition: all 0.2s;
}

/* Neutralize Browser Auto-fill Styling */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
  -webkit-text-fill-color: white !important;
  color: white !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Hide Browser Native Eye Button */
input::-ms-reveal,
input::-ms-clear {
  display: none;
}

.toggle-password:hover {
  opacity: 1;
  color: #fff;
}

.btn-login {
  background: #fff;
  color: #000;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.divider {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 10px 0;
}

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

.divider span {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.social-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--text-dim);
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.login-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-deep);
  border: 1px solid var(--border-bright);
  padding: 40px;
  border-radius: 24px;
  width: 100%;
  max-width: 450px;
  position: relative;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover { color: #fff; }

.modal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #fff;
}

.modal-content p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 30px;
  line-height: 1.5;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-form .input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-silver);
}

.modal-form input, .modal-form textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

.modal-form input:focus, .modal-form textarea:focus { border-color: var(--primary); }

.btn-modal {
  background: #fff;
  color: #000;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
}

.direct-contact {
  font-size: 0.8rem !important;
  text-align: center;
  margin-bottom: 0 !important;
}

.direct-contact a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { 
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Auth Preloader Rework */
.auth-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #020617;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(20px);
}

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

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.logo-pulse {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-pulse img {
  width: 48px;
  height: 48px;
  z-index: 2;
}

/* Minimalist Circular Ring */
.logo-pulse::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(139, 92, 246, 0.1);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.preloader-status {
  color: var(--text-silver);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

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

@keyframes logoPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}
