/* ============================================================================
   Login / Signup pages – modern split layout.
   Left:  brand panel with gradient + decorative blobs.
   Right: form card with floating-icon inputs and animated submit.
   Auto-respects body.theme-dark (set by the early boot script).
   ========================================================================== */

* { box-sizing: border-box; }

:root {
  --primary: #1a73e8;
  --primary-hover: #1765cc;
  --accent: #fbbc04;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #202124;
  --text-muted: #5f6368;
  --border: #e0e3e7;
  --error: #d93025;
  --error-bg: #fce8e6;
  --success: #1e8e3e;
  --shadow-lg: 0 16px 40px rgba(60, 64, 67, 0.18);
}

body.theme-dark {
  --bg: #1a1b1e;
  --surface: #2d2e30;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --border: #3c4043;
  --error: #f28b82;
  --error-bg: rgba(242, 139, 130, 0.15);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

html, body { height: 100%; margin: 0; }

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout shell ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* ---------- Left brand panel ---------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a73e8 0%, #4285f4 50%, #8ab4f8 100%);
  color: #fff;
  padding: 56px 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand-inner {
  position: relative;
  z-index: 2;
  max-width: 460px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Pacifico', cursive;
  font-size: 28px;
  color: #fff;
}
.auth-logo i {
  background: rgba(255, 255, 255, 0.18);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(8px);
}

.auth-tagline {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 700;
  margin: 64px 0 16px;
  letter-spacing: -0.5px;
}

.auth-sub {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.9;
  margin: 0 0 36px;
  max-width: 420px;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  opacity: 0.95;
}
.auth-features i {
  color: var(--accent);
  font-size: 18px;
}

.auth-footnote {
  position: relative;
  z-index: 2;
  font-size: 13px;
  opacity: 0.75;
}

/* Decorative blobs in the brand panel */
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}
.auth-blob.blob-1 {
  width: 360px; height: 360px;
  background: #fbbc04;
  top: -80px; right: -80px;
  opacity: 0.35;
}
.auth-blob.blob-2 {
  width: 320px; height: 320px;
  background: #ea4335;
  bottom: -100px; left: -60px;
  opacity: 0.3;
}
.auth-blob.blob-3 {
  width: 220px; height: 220px;
  background: #34a853;
  top: 40%; left: 50%;
  opacity: 0.22;
}

/* ---------- Right form panel ---------- */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: auth-fade-in 0.4s ease;
}
@keyframes auth-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  font-family: 'Pacifico', cursive;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 28px;
}

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

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.auth-input {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16);
}
.auth-input-icon {
  width: 44px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  flex-shrink: 0;
}
.auth-input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--text);
  padding: 12px;
  min-width: 0;
}
.auth-input input::placeholder { color: var(--text-muted); opacity: 0.7; }

.auth-toggle-pw {
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 44px;
  align-self: stretch;
  color: var(--text-muted);
  font-size: 14px;
  border-radius: 0 10px 10px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-toggle-pw:hover { color: var(--text); background: rgba(0, 0, 0, 0.04); }
body.theme-dark .auth-toggle-pw:hover { background: rgba(255, 255, 255, 0.06); }

/* Error / message banner */
.auth-error {
  background: var(--error-bg);
  color: var(--error);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}
.auth-error[hidden] { display: none; }
.auth-error.is-shake { animation: auth-shake 0.4s ease; }

/* Success message banner – same shape as the error banner. */
.auth-success {
  background: rgba(30, 142, 62, 0.12);
  color: var(--success);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(30, 142, 62, 0.25);
}
.auth-success[hidden] { display: none; }
body.theme-dark .auth-success {
  background: rgba(129, 201, 149, 0.12);
  color: #81c995;
  border-color: rgba(129, 201, 149, 0.25);
}
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Submit */
.auth-submit {
  position: relative;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.25);
  margin-top: 4px;
}
.auth-submit:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(26, 115, 232, 0.35); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.7; cursor: progress; }

/* Inline links row above / below the form (e.g. forgot password). */
.auth-inline-links {
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
  margin-top: -4px;
}
.auth-inline-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.auth-inline-links a:hover { text-decoration: underline; }

/* Alternate link below the form */
.auth-altlink {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-altlink a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.auth-altlink a:hover { text-decoration: underline; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: inline-flex; }
  .auth-card { padding: 32px 24px; }
}
@media (max-width: 480px) {
  .auth-panel { padding: 24px 16px; }
  .auth-card {
    padding: 28px 20px;
    border-radius: 12px;
  }
  .auth-title { font-size: 22px; }
}