/* Presto Design System for Login Page */
:root {
  --presto-primary: #FF4E02;
  --presto-primary-dark: #E54502;
  --presto-primary-light: #FF6B2B;
  
  --grey-50: #F5F6F8;
  --grey-100: #ECEEF2;
  --grey-200: #D6DAE1;
  --grey-300: #B1BAC8;
  --grey-400: #8796A9;
  --grey-500: #68798F;
  --grey-900: #343A46;
  --grey-950: #23272E;
  
  --success: #0EAA14;
  --success-light: #E7F7E8;
  --error: #E82626;
  --error-light: #FFF0F0;
  --warning: #FFE57F;
  --info: #539BFF;
  
  --surface: #FFFFFF;
  --surface-light: #FAFBFC;
  --text-primary: #23272E;
  --text-secondary: #68798F;
  --text-on-primary: #FFFFFF;
  
  /* Override old variables */
  --primary-500: #FF4E02;
  --primary-600: #E54502;
  --primary-700: #CC3D02;
  --primary-400: #FF6B2B;
  --primary-300: #FF8B4F;
  --primary-200: #FFAB73;
  --primary-50: #FFF4EF;
  
  --bg-primary: #FAFBFC;
  --bg-secondary: #FFFFFF;
  --bg-elevated: #F5F6F8;
  --bg-tertiary: #FFFFFF;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  
  --border-primary: #D6DAE1;
  --border-secondary: #ECEEF2;
  
  --success-500: #0EAA14;
  --success-50: #E7F7E8;
  --success-700: #0A7710;
  
  --error-500: #E82626;
  --error-50: #FFF0F0;
  --error-700: #B51E1E;
  
  --text-muted: #8796A9;
  --text-tertiary: #B1BAC8;
  
  --radius-2xl: 16px;
  --radius-xl: 12px;
  --radius-lg: 8px;
  --radius-full: 9999px;
  
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  
  --shadow-2xl: 0 20px 60px rgba(0, 0, 0, 0.3);
  
  --z-modal-backdrop: 9999;
  
  --font-mono: 'Courier New', monospace;
}

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

body {
  font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-light);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--grey-200);
  padding: 16px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header .brand img,
.site-header .brand .logo-dot {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--grey-200);
}

.btn.ghost:hover {
  background: var(--grey-50);
  border-color: var(--grey-300);
}

/* Login Page */
.login-hero {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, var(--surface-light) 0%, #FFFFFF 50%, var(--surface-light) 100%);
  position: relative;
}

.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--grey-200);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  animation: fadeInUp 0.5s ease-out;
  position: relative;
}

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

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.login-logo img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Forms */
.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-primary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--presto-primary);
  box-shadow: 0 0 0 3px rgba(255, 78, 2, 0.1);
  background: var(--surface);
  transform: none;
}

.form-input:hover {
  border-color: var(--grey-300);
}

.form-input::placeholder {
  color: var(--grey-400);
}

.form-extras {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -8px;
  padding: 0;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.remember-me:hover {
  color: var(--text-primary);
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--presto-primary);
  border-radius: 4px;
}

.forgot-password {
  font-size: 14px;
  color: var(--presto-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.forgot-password:hover {
  text-decoration: underline;
  color: var(--presto-primary-dark);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-login, .btn-signup {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login svg,
.btn-signup svg {
  display: none;
}

.btn-login {
  background: var(--presto-primary);
  color: var(--text-on-primary);
}

.btn-login:hover {
  background: var(--presto-primary-dark);
  box-shadow: 0 4px 12px rgba(255, 78, 2, 0.25);
  transform: translateY(-1px);
}

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

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

.btn-signup {
  background: var(--grey-100);
  color: var(--text-primary);
}

.btn-signup:hover {
  background: var(--grey-200);
  transform: translateY(-1px);
}

/* Status Messages */
.status-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--grey-200);
  background: var(--grey-50);
  color: var(--text-secondary);
  min-height: 48px;
  display: flex;
  align-items: center;
  font-family: inherit;
  white-space: pre-wrap;
  transition: all 0.2s ease;
}

.status-message.processing {
  border-color: var(--info);
  background: #EFF6FF;
  color: var(--info);
}

.status-message.success {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.status-message.error {
  border-color: var(--error);
  background: var(--error-light);
  color: var(--error);
}

/* Wakeup Message */
.wakeup-message {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #FFF9E6;
  border: 1px solid #FFE57F;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #806600;
  animation: fadeIn 0.3s ease-out;
}

.wakeup-message.show {
  display: flex;
}

.wakeup-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #FFE57F;
  border-top-color: var(--presto-primary);
  border-radius: 50%;
}

.wakeup-text {
  flex: 1;
}

.wakeup-title {
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.wakeup-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

/* Modal */
.signup-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.signup-modal.show {
  display: flex !important;
}

.signup-modal .modal-content {
  background: var(--surface);
  border: 1px solid var(--grey-200);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--grey-400);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--grey-100);
  color: var(--text-primary);
  transform: scale(1.05);
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-login .loading,
.btn-signup .loading {
  color: inherit;
}

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

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

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

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Version Info */
.version-info {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--grey-400);
  font-size: 11px;
  z-index: 1000;
  font-family: inherit;
}

/* Responsive */
@media (max-width: 640px) {
  .login-card {
    padding: 32px 24px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn-login, .btn-signup {
    width: 100%;
  }
  
  .signup-modal .modal-content {
    padding: 24px;
    margin: 16px;
  }
  
  .container {
    padding: 0 16px;
  }
}
