/* ===== DESIGN TOKENS ===== */
:root {
  --bg-primary: #f8f6f2;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #fcfbfa;
  --bg-input-focus: #ffffff;
  --text-primary: #2d2319;
  --text-secondary: #6b5a4a;
  --text-muted: #928170;
  --accent-primary: #ff7a00;
  --accent-secondary: #ff9f43;
  --accent-glow: rgba(255, 122, 0, 0.12);
  --error-color: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.08);
  --border-color: #e9e2d5;
  --border-focus: #ff7a00;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 25px 60px rgba(45, 35, 25, 0.06);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* ===== LOGIN WRAPPER ===== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  padding: 20px;
}

/* ===== ANIMATED BACKGROUND ===== */
.login-bg-shapes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-primary);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-secondary);
  bottom: -80px;
  left: -80px;
  animation-delay: -7s;
}

.shape-3 {
  width: 250px;
  height: 250px;
  background: #06b6d4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

/* ===== LOGIN CARD ===== */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-card);
  animation: cardSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== LOGO ===== */
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  margin-bottom: 16px;
  display: inline-block;
  animation: logoPulse 3s ease-in-out infinite;
}

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

.login-logo h1 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
  z-index: 1;
}

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

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

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

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

/* Toggle password */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
  z-index: 1;
}

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

/* ===== ERROR MESSAGE ===== */
.error-message {
  display: none;
  padding: 12px 16px;
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--error-color);
  font-size: 0.85rem;
  margin-bottom: 16px;
  animation: shakeIn 0.4s ease;
}

.error-message.visible {
  display: block;
}

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

/* ===== LOGIN BUTTON ===== */
.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

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

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

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  position: absolute;
  right: 16px;
  top: 50%;
  margin-top: -10px;
}

.login-btn.loading .btn-loader {
  display: block;
}

.login-btn.loading .btn-text {
  opacity: 0.7;
}

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

/* ===== FOOTER ===== */
.login-footer {
  margin-top: 28px;
  text-align: center;
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  animation: cardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

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

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

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }

  .login-logo h1 {
    font-size: 1.3rem;
  }
}
