﻿/* =============================================
   RentAll - Authentication Page Styles
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-lighter: #eff6ff;
  --danger: #dc2626;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #1d4ed8 100%);
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  border-radius: 50%;
  z-index: -1;
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(40px) scale(1.05); }
}

/* Floating circles — sit inside .auth-brand (the left panel), behind its content */
.bg-circles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-circles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  animation: rise linear infinite;
}

.bg-circles span:nth-child(1) { width: 80px; height: 80px; left: 10%; animation-duration: 12s; animation-delay: 0s; }
.bg-circles span:nth-child(2) { width: 40px; height: 40px; left: 25%; animation-duration: 8s; animation-delay: 2s; }
.bg-circles span:nth-child(3) { width: 120px; height: 120px; left: 50%; animation-duration: 15s; animation-delay: 4s; }
.bg-circles span:nth-child(4) { width: 60px; height: 60px; left: 70%; animation-duration: 10s; animation-delay: 1s; }
.bg-circles span:nth-child(5) { width: 100px; height: 100px; left: 85%; animation-duration: 14s; animation-delay: 3s; }

@keyframes rise {
  0% { bottom: -150px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.5; }
  100% { bottom: 110%; opacity: 0; }
}

/* Auth wrapper — fills the entire viewport */
.auth-wrapper {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: 0;
  position: relative;
  z-index: 1;
}

/* Auth card — full-screen split: brand panel + form panel side by side */
.auth-card {
  background: var(--white);
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
}

/* Brand header — left panel, full height. Dark, left-aligned layout (logo
   top, big headline + pills mid-panel) rather than the old centered-logo
   look, but kept on the same navy/blue gradient as the rest of the app. */
.auth-brand {
  background:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, #0b1224 0%, #0f172a 45%, #1e3a5f 100%);
  padding: 44px 48px;
  text-align: left;
  color: white;
  flex: 0 0 44%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-brand > *:not(.bg-circles) { position: relative; z-index: 1; }

/* Small top-left wordmark: icon badge + "Elevate Rental" */
.brand-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #cbd5e1;
}
.brand-wordmark strong { color: white; font-weight: 800; }

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.brand-mid { margin: auto 0; padding: 40px 0; }

.brand-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}

.brand-headline {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
  color: white;
}

.brand-subtext {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 380px;
}

/* Auth form — right panel, full height, form centered vertically (and
   horizontally capped so inputs don't stretch edge-to-edge on wide screens) */
.auth-form-wrap {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px clamp(24px, 6vw, 90px);
}

.auth-form-wrap > * {
  width: 100%;
  max-width: 400px;
}

.auth-form-wrap h2 {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.auth-form-wrap .subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* Form groups */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--primary-light);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--primary-lighter);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-wrap input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Extra right padding so typed text never runs under the show/hide-password
   button (only present on password fields). */
.input-wrap:has(.toggle-password) input { padding-right: 44px; }

.input-wrap .toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s;
}

.input-wrap .toggle-password:hover { color: var(--primary); }

/* Remember me / forgot */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Login button */
.btn-login {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  letter-spacing: 0.5px;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* Loading spinner on button */
.btn-login .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error alert */
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--danger);
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  display: none;
  align-items: center;
  gap: 8px;
}

.alert-error.show { display: flex; }

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  color: #166534;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  display: none;
  align-items: center;
  gap: 8px;
}
.alert-success.show { display: flex; }

.forgot-link {
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* Demo credentials hint */
.demo-hint {
  margin-top: 12px;
  padding: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  font-size: 11px;
  color: #0369a1;
}

.demo-hint strong { display: block; margin-bottom: 4px; font-size: 11px; }
.demo-hint table { width: 100%; border-collapse: collapse; }
.demo-hint td { padding: 1px 4px; }
.demo-hint td:first-child { font-weight: 600; color: #0f172a; }

/* Footer */
.auth-footer {
  text-align: center;
  padding-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Input error state */
.input-wrap input.error {
  border-color: var(--danger);
  background: #fff5f5;
}

/* Responsive — below this width the side-by-side split doesn't have room,
   so stack the brand panel above the form and let the page scroll instead
   of forcing everything into exactly one screen. */
@media (max-width: 768px) {
  body { height: auto; min-height: 100vh; overflow: auto; padding: 0; }
  .auth-wrapper { height: auto; min-height: 100vh; }
  .auth-card { flex-direction: column; height: auto; min-height: 100vh; }
  .auth-brand { flex: none; width: 100%; padding: 28px 24px; }
  .brand-mid { padding: 28px 0; }
  .brand-headline { font-size: 28px; }
  .auth-form-wrap { flex: none; height: auto; padding: 24px 20px 28px; }
}

@media (max-width: 480px) {
  .auth-brand { padding: 20px 16px; }
  .brand-headline { font-size: 24px; }
  .brand-subtext { font-size: 13px; }
  .auth-form-wrap { padding: 18px 16px 20px; }
  .auth-form-wrap h2 { font-size: 24px; }
}

