/* ============================================================================
📁 FILE: static/css/auth-login.css
🎯 PURPOSE: Auth Page Styling — Compact Form, Inputs, Buttons, Tips
✍️ AUTHOR: Captain & Chatman
🔖 VERSION: MPA Auth v1.3 — Tokenized (theme-aware) + a11y polish
============================================================================ */

/* ------------------------------
   Local tokens (inherit TS when present; fallback to current look)
------------------------------ */
body {
  --auth-grad-1: color-mix(in srgb, var(--brand, #0f2027) 60%, black 40%);
  --auth-grad-2: color-mix(in srgb, var(--primary, #203a43) 85%, #0f2027 15%);
  --auth-grad-3: color-mix(in srgb, var(--primary, #2c5364) 100%, #12222a 0%);

  --auth-surface: #1e1e2f; /* form card */
  --auth-text: #ffffff;
  --auth-text-muted: #aaa;

  --auth-input-bg: #333;
  --auth-input-fg: #fff;
  --auth-input-ph: #aaa;

  --auth-accent: var(--accent, #00d4ff); /* buttons/links */
  --auth-accent-hover: color-mix(
    in srgb,
    var(--accent, #00d4ff) 85%,
    #0087a1 15%
  );
  --auth-btn-fg: #000;

  --auth-error-bg: #ffe5e5;
  --auth-error-fg: #a80000;
  --auth-error-bd: #ffcccc;
  --auth-ok-bg: #e6ffe6;
  --auth-ok-fg: #006600;
  --auth-ok-bd: #b3ffb3;

  --auth-teal: #006373; /* small accents kept from original */
}

/* ------------------------------
   Page frame
------------------------------ */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    to right,
    var(--auth-grad-1),
    var(--auth-grad-2),
    var(--auth-grad-3)
  );
  color: var(--auth-text);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* don't center vertically */
  padding-top: 20px; /* move box down */
  padding-bottom: 40px;
  min-height: 100vh;
  margin: 0;
}

/* 🔧 Auth Container */
.auth-container {
  background-color: var(--auth-surface);
  padding: 22px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
}

/* Close (X) button in the top-right corner */
.auth-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  text-decoration: none;
  color: var(--auth-text, #fff);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease,
    opacity 0.15s ease;
}
.auth-close:hover {
  background: rgba(0, 0, 0, 0.35);
  transform: scale(1.04);
}
.auth-close:active {
  transform: scale(0.98);
}

/* 🧠 Header Font Styling */
.ionabrand-white {
  font-size: 18px;
  color: #fff;
  font-weight: bold;
}
.setup-blue {
  font-size: 18px;
  color: var(--auth-accent);
  font-weight: normal;
  margin-left: 6px;
}

/* ✅ Header with Logo and Text */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 4px;
}
.auth-logo {
  width: 60px;
  max-width: 60px;
  height: auto;
  flex-shrink: 0;
  aspect-ratio: auto;
  object-fit: contain;
}
.auth-heading-text h1 {
  font-size: 16px;
  margin: 0;
  color: #fff;
}
.auth-heading-text h2 {
  font-size: 16px;
  margin: 2px 0 0;
  color: var(--auth-accent);
}

/* 🔐 Input Fields */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  width: 90%;
  padding: 7px 9px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background-color: var(--auth-input-bg);
  color: var(--auth-input-fg);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder {
  color: var(--auth-input-ph);
}

/* Focus ring (keyboard-visible) */
input[type],
input:not([type]) {
  outline: none;
}
input[type]:focus-visible {
  border-color: color-mix(in srgb, var(--auth-accent) 70%, white 30%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 25%, transparent);
  border-radius: 5px;
}

/* 👁️ Password Toggle */
.input-group {
  position: relative;
}
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 13px;
  color: #ccc;
}

/* 🔘 Button */
button {
  width: 90%;
  padding: 5px;
  background-color: var(--auth-accent);
  border: none;
  border-radius: 10px;
  color: var(--auth-btn-fg);
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, filter 0.2s ease;
  margin-top: 6px;
}
button:hover {
  background-color: var(--auth-accent-hover);
  transform: scale(1.03);
}
button:active {
  transform: scale(0.98);
}
button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--auth-accent) 60%, white 40%);
  outline-offset: 2px;
}

/* 📋 Notes and Tips */
.form-note,
.form-notes,
.requirements,
.save-tip {
  font-size: 12px;
  margin-top: 6px;
  text-align: left;
}
.note-header {
  margin-bottom: 4px;
}
.requirements {
  padding-left: 16px;
  list-style-type: disc;
  color: #ccc;
}
.save-tip {
  color: var(--auth-text-muted);
  margin-top: 6px;
}

/* 🧯 Alerts */
.auth-error,
.auth-success {
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  text-align: left;
}
.auth-error {
  background-color: var(--auth-error-bg);
  color: var(--auth-error-fg);
  border: 1px solid var(--auth-error-bd);
}
.auth-success {
  background-color: var(--auth-ok-bg);
  color: var(--auth-ok-fg);
  border: 1px solid var(--auth-ok-bd);
}
.redirect-options {
  font-weight: normal;
  font-size: 0.9em;
  margin-top: 6px;
}

/* 🔗 Forgot */
.forgot-link {
  display: block;
  margin-top: 10px;
  text-align: left;
  color: var(--auth-accent);
}
.forgot-link a,
.forgot-link a:visited {
  color: color-mix(in srgb, var(--auth-accent) 70%, #bb88ff 30%);
  text-decoration: none;
  font-weight: 600;
}
.forgot-link:hover a {
  text-decoration: underline;
}

/* 🦶 Footer */
.auth-footer {
  margin-top: 20px;
  font-size: 0.75em;
  color: #888;
}

/* Motion preference respect */
@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
  input[type]:focus-visible {
    box-shadow: 0 0 0 2px
      color-mix(in srgb, var(--auth-accent) 25%, transparent);
  }
}
