@import url("variables.css");

/* ============================================================================
   Login Page Styles
   ============================================================================ */
html,
body {
  height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(
    circle at 12% 20%,
    #e3edff 0,
    var(--bg) 38%,
    #f9fbff 100%
  );
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ============================================================================
   Login Container
   ============================================================================ */
.login-container {
  width: 100%;
  max-width: 420px;
  animation: fadeIn 0.4s ease-out;
}

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

/* ============================================================================
   Login Card
   ============================================================================ */
.login-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-strong);
  border: 1px solid var(--border);
  padding: 32px;
  animation: slideUp 0.5s ease-out;
}

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

/* ============================================================================
   Login Header
   ============================================================================ */
.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header h1 {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================================================
   Login Form
   ============================================================================ */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.form-group input::placeholder {
  color: var(--muted-2);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow:
    0 0 0 3px rgba(14, 165, 233, 0.1),
    0 4px 12px rgba(14, 165, 233, 0.15);
}

.form-group input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================================
   Error Message
   ============================================================================ */
.error-message {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-s);
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

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

/* ============================================================================
   Login Button
   ============================================================================ */
.login-button {
  width: 100%;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--radius-s);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(14, 165, 233, 0.4);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

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

.login-button:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(14, 165, 233, 0.3),
    0 12px 30px rgba(14, 165, 233, 0.35);
}

/* ============================================================================
   Button States
   ============================================================================ */
.button-text,
.button-spinner {
  display: inline-block;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

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

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

.hidden {
  display: none !important;
}

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

  .login-header h1 {
    font-size: 24px;
  }

  .login-subtitle {
    font-size: 14px;
  }
}

/* ============================================================================
   Accessibility
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
