/*
 * Modern styling for the public auth pages (login, register, forgot, approve).
 * Self-contained — uses the same design tokens as the React app, so these pages
 * match the product visually without depending on Bootstrap/AdminLTE.
 */
:root {
  --color-bg: #0f141a;
  --color-surface: #1c222a;
  --color-surface-2: #232b34;
  --color-border: #333d49;
  --color-text: #e7ecf2;
  --color-text-muted: #9aa7b5;
  --color-text-subtle: #6f7d8c;
  --color-primary: #2f6fed;
  --color-primary-hover: #4b83f0;
  --color-primary-contrast: #ffffff;
  --color-danger: #e5484d;
  --color-success: #30a46c;
  --radius-md: 8px;
  --radius-lg: 14px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Rubik, Assistant, "Helvetica Neue", Arial, sans-serif;
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* the auth pages own the whole viewport with a subtle gradient ground */
body.auth-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  font-family: var(--font-sans);
  color: var(--color-text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(47, 111, 237, 0.18), transparent 60%),
    var(--color-bg);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
body.auth-body * { box-sizing: border-box; }

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5) var(--space-5);
}
.auth-brand__logo {
  width: 34px;
  height: 34px;
}
.auth-brand__name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.auth-body-wrap { padding: 0 var(--space-6) var(--space-6); }

.auth-title {
  font-size: 15px;
  color: var(--color-text-muted);
  text-align: center;
  margin: 0 0 var(--space-5);
}

.auth-field { margin-bottom: var(--space-4); }
.auth-label {
  display: block;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: var(--color-text-subtle); }
.auth-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  cursor: pointer;
  user-select: none;
}
.auth-check input { width: 16px; height: 16px; accent-color: var(--color-primary); cursor: pointer; }

.auth-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.auth-btn:hover { background: var(--color-primary-hover); }
.auth-btn:active { transform: translateY(1px); }

.auth-sep {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-subtle);
  font-size: 12px;
  margin: var(--space-5) 0;
}
.auth-sep::before, .auth-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-google { display: flex; justify-content: center; min-height: 44px; }

.auth-links {
  margin-top: var(--space-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.auth-links a { color: var(--color-primary); text-decoration: none; font-size: 14px; }
.auth-links a:hover { text-decoration: underline; }
.auth-back {
  display: block;
  text-align: center;
  margin-top: var(--space-5);
  color: var(--color-text-subtle);
  font-size: 13px;
  text-decoration: none;
}
.auth-back:hover { color: var(--color-text-muted); }

/* messages (auth.js writes .alert alert-danger / alert-success) */
/* id+class beats the legacy #alert_placeholder{position:fixed;bottom} rule */
#alert_placeholder.auth-msg {
  position: static;
  width: auto;
  height: auto;
  line-height: normal;
  padding: 0;
  left: auto;
  bottom: auto;
}
.auth-msg:empty { display: none; }
#alert_placeholder.auth-msg { margin-bottom: var(--space-4); }
#alert_placeholder.auth-msg .alert {
  height: auto;
  line-height: 1.4;
  text-align: start;
  width: auto;
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 10px var(--space-4);
  margin: 0;
}
.auth-msg .alert {
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  border: 1px solid transparent;
}
.auth-msg .alert-danger {
  background: rgba(229, 72, 77, 0.14);
  color: #ff9b9e;
  border-color: rgba(229, 72, 77, 0.35);
}
.auth-msg .alert-success {
  background: rgba(48, 164, 108, 0.14);
  color: #6fd6a2;
  border-color: rgba(48, 164, 108, 0.35);
}

@media (max-width: 460px) {
  .auth-body-wrap { padding: 0 var(--space-4) var(--space-5); }
  .auth-brand { padding: var(--space-5) var(--space-4) var(--space-4); }
}

/* --- wider card + 2-column grid for the register form --- */
.auth-card--wide { max-width: 720px; }
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-5);
}
@media (max-width: 640px) { .auth-grid { grid-template-columns: 1fr; } }

/* select styled like .auth-input, with a chevron */
select.auth-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa7b5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: 34px;
}

/* short explanatory paragraph (forgot page) */
.auth-note {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 var(--space-4);
}

/* captcha row */
.auth-captcha { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); margin-bottom: var(--space-3); }
.auth-captcha img { border-radius: var(--radius-md); border: 1px solid var(--color-border); max-width: 100%; }
.auth-captcha a { flex-basis: 100%; font-size: 12.5px; color: var(--color-primary); text-decoration: none; }
.auth-captcha a:hover { text-decoration: underline; }
