/* ===== PLATO MATH AUTHENTICATION THEME ===== */

/* Font definitions to ensure consistency */
:root {
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  
  /* Cosmic button colors */
  --cosmic: 240 50% 20%;
  --cosmic-foreground: 0 0% 100%;
  --secondary: 213 50% 35%;
  --gradient-cosmic: linear-gradient(135deg, hsl(var(--cosmic)) 0%, hsl(var(--secondary)) 100%);
  --shadow-cosmic: 0 20px 60px -15px hsla(var(--cosmic) / 0.25);
}

/* Cosmic button styles */
.btn-cosmic {
  background: var(--gradient-cosmic);
  color: hsl(var(--cosmic-foreground));
  box-shadow: var(--shadow-cosmic);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  /* Fix for tab switching rendering issues */
  will-change: transform;
  transform: translateZ(0);
}

.btn-cosmic:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 25px 70px -20px hsla(var(--cosmic) / 0.3);
}

/* Page background with Greek pattern and cosmic elements */
.auth-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  font-family: var(--font-body);
}

/* Ensure all elements within auth pages use the correct font */
.auth-page * {
  font-family: var(--font-body);
}

.auth-page h1, .auth-page h2, .auth-page h3, .auth-page h4, .auth-page h5, .auth-page h6 {
  font-family: var(--font-heading);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh; /* Add this back to ensure full height coverage */
  background: linear-gradient(135deg, #fcfbf9 0%, #fcfbf9 100%);
  background-attachment: fixed; /* This ensures the background covers the full scrollable area */
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-body);
}

body::before {
  content: '';
  position: fixed; /* Fixed positioning so it doesn't scroll */
  top: -50px; /* Extend beyond viewport bounds */
  left: -50px;
  right: -50px;
  bottom: -50px;
  background-image: 
    repeating-linear-gradient(
      90deg,
      rgba(52, 101, 164, 0.1) 0px,
      rgba(52, 101, 164, 0.1) 1px,
      transparent 1px,
      transparent 20px
    );
  opacity: 0.6;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed; /* Fixed positioning so it doesn't scroll */
  top: -50px; /* Extend beyond viewport bounds */
  left: -50px;
  right: -50px;
  bottom: -50px;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(51, 51, 153, 0.2), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(169, 180, 214, 0.25), transparent);
  background-repeat: repeat;
  background-size: 150px 100px;
  opacity: 0.7;
  z-index: -1;
}

/* Main container */
.auth-container {
  max-width: 500px;
  margin: 40px auto;
  padding: 40px;
  background-color: hsla(0, 0%, 100%, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  box-shadow: 0 10px 40px -10px hsla(18, 95%, 60%, 0.15);
  border: 1px solid hsla(210, 20%, 90%, 0.5);
  position: relative;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Fix for tab switching rendering issues */
  will-change: transform;
  transform: translateZ(0);
}

.auth-container:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 20px 60px -15px hsla(18, 95%, 60%, 0.2);
}

/* Header styling */
.auth-header {
  text-align: center;
  margin-bottom: 30px;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f97316, #fb923c, #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Welcome message */
.auth-welcome {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, hsla(213, 50%, 35%, 0.05) 0%, hsla(18, 95%, 60%, 0.05) 100%);
  border-radius: 0.75rem;
  border-left: 4px solid hsl(18, 95%, 60%);
  color: hsl(220, 25%, 25%);
  font-size: 1.1rem;
  line-height: 1.6;
  font-family: var(--font-body);
}

.auth-welcome p {
  font-family: var(--font-body);
  margin: 0;
}

/* Form fields */
.field {
  margin-bottom: 25px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: hsl(220, 25%, 25%);
  font-size: 1rem;
  font-family: var(--font-body);
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid hsl(210, 20%, 90%);
  border-radius: 0.75rem;
  font-size: 16px;
  background-color: hsl(0, 0%, 100%);
  color: hsl(220, 25%, 25%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: var(--font-body);
  /* Fix for tab switching rendering issues */
  will-change: transform;
  transform: translateZ(0);
}

.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="text"]:focus {
  outline: none;
  border-color: hsl(18, 95%, 60%);
  box-shadow: 0 0 0 3px hsla(18, 95%, 60%, 0.1);
  transform: translateY(-1px) translateZ(0);
}

/* Remember me checkbox */
.remember-me {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
}

.remember-me input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  accent-color: hsl(18, 95%, 60%);
}

.remember-me label {
  color: hsl(215, 15%, 50%);
  font-weight: 500;
  margin: 0;
  font-family: var(--font-body);
}

/* Submit button */
.actions {
  margin-top: 30px;
  text-align: center;
}

.actions input[type="submit"] {
  background: linear-gradient(135deg, hsl(18, 95%, 60%) 0%, hsl(18, 100%, 70%) 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px -10px hsla(18, 95%, 60%, 0.3);
  min-width: 200px;
  font-family: var(--font-body);
  /* Fix for tab switching rendering issues */
  will-change: transform;
  transform: translateZ(0);
}

.actions input[type="submit"]:hover {
  transform: translateY(-2px) scale(1.02) translateZ(0);
  box-shadow: 0 15px 50px -10px hsla(18, 95%, 60%, 0.4);
}

.actions input[type="submit"]:active {
  transform: translateY(0) scale(0.98) translateZ(0);
}

/* Devise links */
.devise-links {
  margin-top: 30px;
  text-align: center;
  padding-top: 25px;
  border-top: 1px solid hsl(210, 20%, 90%);
}

.devise-links a {
  color: hsl(18, 95%, 60%);
  text-decoration: none;
  margin: 0 15px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 16px;
  border-radius: 0.5rem;
  font-family: var(--font-body);
  /* Fix for tab switching rendering issues */
  will-change: transform;
  transform: translateZ(0);
}

.devise-links a:hover {
  color: hsl(18, 100%, 70%);
  background-color: hsla(18, 95%, 60%, 0.1);
  transform: translateY(-1px) translateZ(0);
}

/* Decorative elements */
.auth-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, hsl(18, 95%, 60%), hsl(213, 50%, 35%));
  border-radius: 1rem;
  z-index: -1;
  opacity: 0.1;
}

/* Responsive design */
@media (max-width: 640px) {
  .auth-container {
    margin: 20px;
    padding: 30px 25px;
  }
  
  .auth-header {
    font-size: 2rem;
  }
  
  .actions input[type="submit"] {
    width: 100%;
    min-width: auto;
  }
}