/* ============================================================
   login.css  —  Styles for the Login page (index.html)
   ============================================================ */

/* ── Reset & Base ────────────────────────────────────────────
   Browsers add their own default margin/padding/box-sizing.
   We clear those so our design looks the same everywhere.    */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* padding stays INSIDE the width,
                             not added on top of it           */
}

body {
  font-family: var(--font-ui);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;       /* full viewport height             */
  display: flex;           /* puts children side by side       */
}

/* ── Page wrapper ────────────────────────────────────────────
   Two columns: left branding panel + right form panel.      */
.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* =============================================================
   LEFT PANEL  —  Branding
   ============================================================= */
.left-panel {
  flex: 1.1;               /* takes slightly more than half    */
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  position: relative;
  overflow: hidden;        /* clips the decorative lines       */
  border-right: 1px solid var(--color-border);
}

/* Subtle grid-line background — purely decorative */
.left-panel::before {
  content: '';
  position: absolute;
  inset: 0;               /* shorthand for top/right/bottom/left: 0 */
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.25;
  pointer-events: none;   /* clicks pass through this layer    */
}

/* Orange glow blob in the bottom-left corner */
.left-panel::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,107,0,0.18) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Logo ────────────────────────────────────────────────── */
.logo {
  font-family: var(--font-logo);
  font-size: 2.4rem;        /* rem = relative to root font size */
  letter-spacing: 3px;
  line-height: 1;
  position: relative;       /* sits above ::before pseudo-layer */
  z-index: 1;
}

.logo span.white { color: var(--color-text); }
.logo span.orange { color: var(--color-accent); }

/* Small label under logo */
.logo-tagline {
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-top: 6px;
  font-family: var(--font-ui);
  position: relative;
  z-index: 1;
}

/* ── Hero text (centre of left panel) ───────────────────── */
.hero {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-logo);
  font-size: 3.8rem;
  line-height: 1.05;
  letter-spacing: 2px;
  margin-bottom: 20px;
  color: var(--color-text);
}

/* The orange word inside the hero title */
.hero-title .accent { color: var(--color-accent); }

.hero-desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 380px;
}

/* ── Stat Cards ──────────────────────────────────────────── */
/* Three numbers at the bottom of the left panel */
.stats-row {
  display: flex;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.stat-card {
  flex: 1;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: border-color 0.25s;
}

.stat-card:hover { border-color: var(--color-accent); }

.stat-value {
  font-family: var(--font-data);   /* Space Mono for numbers   */
  font-size: 1.5rem;
  color: var(--color-text);
  display: block;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Left panel footer (Privacy Policy link) ────────────────── */
.left-panel-footer {
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.left-panel-footer a {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.left-panel-footer a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* =============================================================
   RIGHT PANEL  —  Form
   ============================================================= */
.right-panel {
  flex: 0.9;
  background-color: var(--color-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.form-box {
  width: 100%;
  max-width: 400px;         /* form never stretches too wide    */
}

/* ── Verification link confirmation ──────────────────────── */
.auth-notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 24px;
}
.auth-notice.hidden { display: none; }

.auth-notice--success {
  background: rgba(0, 193, 118, 0.1);
  border: 1px solid rgba(0, 193, 118, 0.3);
  color: var(--color-green);
}

.auth-notice--error {
  background: rgba(255, 61, 61, 0.1);
  border: 1px solid rgba(255, 61, 61, 0.3);
  color: var(--color-red);
}

/* ── Form header ─────────────────────────────────────────── */
.form-title {
  font-family: var(--font-logo);
  font-size: 2.2rem;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 36px;
}

/* ── Input group: label + input together ─────────────────── */
.input-group {
  display: flex;
  flex-direction: column;   /* stacks label above input         */
  gap: 8px;
  margin-bottom: 20px;
}

.input-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

.input-group input {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  padding: 13px 16px;
  outline: none;            /* removes default browser outline  */
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

/* Highlight the input when the user clicks into it */
.input-group input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

/* ── Password row: input + show/hide toggle ─────────────── */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 48px;      /* room for the eye icon            */
}

.toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s;
}

.toggle-pw:hover { color: var(--color-text); }

/* ── Forgot password link ────────────────────────────────── */
.forgot-row {
  text-align: right;
  margin-top: -10px;        /* pull it up closer to the input   */
  margin-bottom: 28px;
}

.forgot-row a {
  font-size: 0.8rem;
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.forgot-row a:hover { opacity: 0.75; }

/* ── Primary button ──────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
  background: #e55e00;      /* slightly darker orange           */
  box-shadow: 0 4px 20px rgba(255, 107, 0, 0.35);
}

.btn-primary:active {
  transform: scale(0.985); /* tiny press-down feel              */
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
}

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

.divider span {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── Google Sign-In button ───────────────────────────────────
   Google's real rendered button (an iframe, injected via renderButton()
   in js/auth.js) can't have its white logo backing removed or be
   repositioned via CSS, so it's kept but made invisible and stacked
   exactly on top of the custom-styled button below it -- clicks land
   on the real Google button, but what's visible is fully ours. */
.google-signin-wrap {
  position: relative;
  min-height: 44px; /* holds layout steady while the SDK/button loads */
}

.google-signin-btn-custom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #131314;
  color: #e3e3e3;
  border: 1px solid #8e918f;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 13px 16px;
  cursor: pointer;
}

.google-signin-icon {
  flex-shrink: 0;
}

.google-signin-btn {
  position: absolute;
  inset: 0;
  opacity: 0;
  overflow: hidden;
}

/* ── Sign-up link ────────────────────────────────────────── */
.signup-row {
  text-align: center;
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.signup-row a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
  transition: opacity 0.2s;
}

.signup-row a:hover { opacity: 0.75; }

/* ── Error message under inputs ──────────────────────────── */
.error-msg {
  font-size: 0.78rem;
  color: var(--color-red);
  margin-top: -14px;
  margin-bottom: 14px;
  display: none;            /* hidden by default; shown via JS  */
}

.error-msg.visible { display: block; }

/* ── Generic visibility utility ──────────────────────────── */
.hidden { display: none; }

/* =============================================================
   RESPONSIVE  —  stack panels on small screens
   ============================================================= */
@media (max-width: 768px) {
  /* @media = "only apply these styles when screen width ≤ 768px"
     On phones, we hide the left branding panel and show only
     the form panel full-width.                               */

  .left-panel { display: none; }

  .right-panel {
    flex: 1;
    padding: 40px 24px;
  }
}
