/* ==========================================
   FREYAI LOGIN - CLEAN DESIGN WITH ANIMATED BACKGROUND
   Google-inspired card + Landing page hero background
   ========================================== */

:root {
  --primary-blue: #1a73e8;
  --primary-blue-hover: #1557b0;
  
  /* Brand colors from landing page */
  --brand-cyan: #38bdf8;
  --brand-teal: #14b8a6;
  --brand-purple: #818cf8;
  --brand-violet: #8b5cf6;
  --brand-indigo: #6366f1;
  
  --grad-brand: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --grad-purple: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-teal: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  
  --bg: #ffffff;
  --bg-canvas: #f8fafc;
  
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --text-link: #1a73e8;
  
  --border: #dadce0;
  --border-focus: #1a73e8;
  
  --error: #d93025;
  --success: #1e8e3e;
  
  --shadow-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-2: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.08);
  
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== AUTH PAGE LAYOUT ==================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  position: relative;
  overflow: hidden;
}

/* ==================== ANIMATED BACKGROUND (from landing hero) ==================== */

/* Gradient Blobs */
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: blobFloat 25s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.auth-blob-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4) 0%, rgba(129, 140, 248, 0.3) 100%);
  top: -200px;
  right: -100px;
}

.auth-blob-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.2) 100%);
  bottom: -150px;
  left: -150px;
  animation-delay: -8s;
}

.auth-blob-3 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.3) 0%, rgba(56, 189, 248, 0.2) 100%);
  top: 40%;
  left: 5%;
  animation-delay: -16s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Floating Shapes */
.auth-shape {
  position: absolute;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  animation: shapeAppear 1s ease forwards, shapeFloat 12s ease-in-out infinite;
}

.auth-shape-1 {
  width: 56px;
  height: 56px;
  background: var(--grad-brand);
  border-radius: 16px;
  top: 15%;
  left: 8%;
  animation-delay: 0.2s, 0s;
}

.auth-shape-2 {
  width: 40px;
  height: 40px;
  background: var(--brand-teal);
  border-radius: 50%;
  top: 20%;
  right: 10%;
  animation-delay: 0.4s, -3s;
}

.auth-shape-3 {
  width: 72px;
  height: 72px;
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  bottom: 25%;
  left: 6%;
  animation-delay: 0.6s, -6s;
}

.auth-shape-4 {
  width: 32px;
  height: 32px;
  background: var(--grad-purple);
  border-radius: 10px;
  top: 55%;
  right: 8%;
  transform: rotate(45deg);
  animation-delay: 0.8s, -9s;
}

.auth-shape-5 {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.8), rgba(13, 148, 136, 0.8));
  border-radius: 14px;
  bottom: 20%;
  right: 15%;
  animation-delay: 1s, -4s;
}

.auth-shape-6 {
  width: 24px;
  height: 24px;
  background: var(--brand-cyan);
  border-radius: 6px;
  top: 40%;
  left: 12%;
  animation-delay: 1.2s, -7s;
}

.auth-shape-7 {
  width: 36px;
  height: 36px;
  background: var(--grad-brand);
  border-radius: 50%;
  bottom: 35%;
  right: 25%;
  animation-delay: 0.3s, -2s;
}

.auth-shape-8 {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  top: 30%;
  left: 20%;
  animation-delay: 0.9s, -5s;
}

@keyframes shapeAppear {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 0.7; transform: scale(1); }
}

@keyframes shapeFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* ==================== NAVIGATION ==================== */

.nav-auth {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  position: relative;
  z-index: 10;
}

.nav-logo {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-logo span {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

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

.nav-auth-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-right: 8px;
}

/* ==================== AUTH CONTAINER ==================== */

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: calc(100vh - 140px);
  position: relative;
  z-index: 1;
}

/* Hide the info panel */
.auth-info {
  display: none !important;
}

/* ==================== AUTH CARD ==================== */

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

/* ==================== AUTH HEADER ==================== */

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

.auth-icon {
  width: 56px;
  height: 56px;
  background: var(--grad-brand);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
}

.auth-icon .material-icons {
  font-size: 1.625rem;
  color: white;
}

.auth-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
}

/* ==================== AUTH MESSAGES ==================== */

.auth-messages-container {
  min-height: 52px;
  margin-bottom: 8px;
}

.auth-messages {
  margin: 0;
}

.auth-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.auth-message:last-child {
  margin-bottom: 0;
}

.auth-message .material-icons {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-message-error {
  background: #fce8e6;
  color: var(--error);
}

.auth-message-success {
  background: #e6f4ea;
  color: var(--success);
}

.auth-message-info {
  background: #e8f0fe;
  color: var(--primary-blue);
}

/* ==================== AUTH FORM ==================== */

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

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

.form-label {
  display: none;
}

.form-input-wrapper {
  position: relative;
}

.form-input-icon {
  display: none;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard);
  outline: none;
}

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

.form-input:hover {
  border-color: var(--text-secondary);
}

.form-input:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Password Toggle */
.form-input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.form-input-toggle .material-icons {
  font-size: 1.25rem;
}

.form-input-wrapper:has(.form-input-toggle) .form-input {
  padding-right: 44px;
}

/* ==================== FORM OPTIONS ==================== */

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -4px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-cyan);
  cursor: pointer;
  border-radius: 4px;
}

.form-link {
  font-size: 0.875rem;
  color: var(--brand-cyan);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.form-link:hover {
  color: var(--brand-purple);
  text-decoration: underline;
}

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease-standard);
  text-decoration: none;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--grad-brand);
  color: white;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.5);
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-canvas);
  border-color: var(--brand-cyan);
}

.btn-full {
  width: 100%;
  padding: 14px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 8px;
}

.btn-full .material-icons {
  font-size: 1.125rem;
}

/* ==================== DIVIDER ==================== */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

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

.auth-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ==================== SOCIAL LOGIN ==================== */

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease-standard);
  font-family: inherit;
}

.btn-social:hover {
  background: var(--bg-canvas);
  border-color: var(--text-muted);
  box-shadow: var(--shadow-1);
}

.btn-social:active {
  background: #f1f3f4;
}

.btn-social svg {
  flex-shrink: 0;
}

/* ==================== AUTH FOOTER ==================== */

.auth-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.auth-footer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--brand-cyan);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ==================== PAGE FOOTER ==================== */

.page-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.page-footer-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.page-footer-lang {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.page-footer-links {
  display: flex;
  gap: 24px;
}

.page-footer-links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.page-footer-links a:hover {
  color: var(--text-primary);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 640px) {
  .nav-auth {
    padding: 12px 16px;
  }
  
  .nav-logo {
    font-size: 1.25rem;
  }
  
  .nav-auth-text {
    display: none;
  }
  
  .auth-container {
    padding: 16px;
    align-items: flex-start;
    padding-top: 32px;
  }
  
  .auth-card {
    padding: 32px 24px;
    border-radius: 16px;
    max-width: 100%;
  }
  
  .auth-header {
    margin-bottom: 24px;
  }
  
  .auth-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
  }
  
  .auth-icon .material-icons {
    font-size: 1.375rem;
  }

  .auth-title {
    font-size: 1.375rem;
  }

  .auth-subtitle {
    font-size: 0.875rem;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  /* Hide some shapes on mobile */
  .auth-shape-3,
  .auth-shape-5,
  .auth-shape-7,
  .auth-shape-8 {
    display: none;
  }
  
  .auth-blob-1 {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -150px;
  }
  
  .auth-blob-2 {
    width: 350px;
    height: 350px;
    bottom: -100px;
    left: -100px;
  }
  
  .auth-blob-3 {
    width: 200px;
    height: 200px;
  }
  
  .page-footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .page-footer-left {
    flex-direction: column;
    gap: 12px;
  }
  
  .page-footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
}

@media (max-width: 400px) {
  .auth-card {
    padding: 28px 20px;
  }

  .auth-title {
    font-size: 1.25rem;
  }

  .form-input {
    padding: 12px 14px;
    font-size: 0.9375rem;
  }

  .btn-full {
    padding: 12px 20px;
    font-size: 0.875rem;
  }
  
  .auth-shape-1,
  .auth-shape-2,
  .auth-shape-4,
  .auth-shape-6 {
    transform: scale(0.7);
  }
}

/* ==================== ANIMATIONS ==================== */

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

.auth-card {
  animation: fadeIn 0.4s var(--ease-out-expo);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
  
  .auth-blob,
  .auth-shape {
    animation: none;
    opacity: 0.5;
  }
  
  * {
    transition-duration: 0.01ms !important;
  }
}