/* =====================================================================
   assets/css/login.css - the sign-in page (index.php).
   Self-contained on purpose: the login page loads before anyone is
   authenticated and shares nothing with app.css. Colors are the same
   CSS variables the rest of the app uses; index.php overrides these
   fallbacks with the saved Settings > Appearance values.
   ===================================================================== */
:root {
  --primary: #2E8B57;
  --secondary: #1F5C3D;
  --bg: #F6FAF8;
  --text-on-dark: #F3FAF6;
  --text-on-light: #1F2937;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.lg-body {
  margin: 0; min-height: 100vh; position: relative;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #0f172a; background: var(--bg); -webkit-font-smoothing: antialiased;
}
/* soft brand-tinted glow behind the card (plain rgba first, color-mix upgrade after) */
.lg-body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(46,139,87,.13), transparent 60%),
    radial-gradient(800px 420px at 100% 108%, rgba(31,92,61,.12), transparent 60%);
  background:
    radial-gradient(900px 420px at 8% -8%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    radial-gradient(800px 420px at 100% 108%, color-mix(in srgb, var(--secondary) 14%, transparent), transparent 60%);
}
.lg-body.has-bg { background-size: cover; background-position: center; background-attachment: fixed; }
.lg-body.has-bg::before { background: rgba(15, 23, 42, .45); }

.lg-main {
  position: relative; z-index: 1; min-height: 100vh; padding: 2rem 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lg-card {
  width: 100%; max-width: 430px; overflow: hidden; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .25);
}

/* ---- header band */
.lg-head { position: relative; overflow: hidden; padding: 2.25rem 2rem 2.5rem; background: var(--secondary); color: var(--text-on-dark); }
.lg-ring { position: absolute; right: -3rem; top: -5rem; width: 14rem; height: 14rem; border-radius: 50%; border: 35px solid rgba(255,255,255,.06); }
.lg-brand { position: relative; display: flex; align-items: center; gap: .75rem; }
.lg-logo {
  width: 3rem; height: 3rem; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: 1rem; background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.lg-logo svg { width: 1.75rem; height: 1.75rem; }
.lg-logo img { width: 100%; height: 100%; object-fit: contain; padding: .35rem; }
.lg-brand-name { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.lg-brand-sub { margin: .1rem 0 0; font-size: .75rem; letter-spacing: .02em; line-height: 1.35; opacity: .8; }
.lg-welcome { position: relative; margin-top: 2.25rem; }
.lg-welcome h1 { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.lg-welcome p { margin: .25rem 0 0; font-size: .875rem; opacity: .85; }

/* ---- form */
.lg-pad { padding: 2rem; }
.lg-alert {
  display: flex; align-items: flex-start; gap: .6rem; margin-bottom: 1.25rem; padding: .75rem 1rem;
  border: 1px solid #fecaca; border-radius: .75rem; background: #fef2f2; color: #991b1b;
  font-size: .875rem; line-height: 1.4;
}
.lg-alert svg { flex-shrink: 0; margin-top: .1rem; }
.lg-form { display: flex; flex-direction: column; gap: 1.25rem; }
.lg-field label { display: block; margin-bottom: .5rem; font-size: .875rem; font-weight: 600; color: #334155; }
.lg-input-wrap { position: relative; }
.lg-input-icon { position: absolute; left: 1rem; top: 50%; width: 1.25rem; height: 1.25rem; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.lg-input-wrap input {
  display: block; width: 100%; padding: .875rem 1rem .875rem 3rem;
  font: inherit; font-size: .875rem; color: #0f172a; background: #fff;
  border: 1px solid #e2e8f0; border-radius: .75rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.lg-input-wrap input#password { padding-right: 4.25rem; }
.lg-input-wrap input::placeholder { color: #94a3b8; }
.lg-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(46,139,87,.18);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.lg-toggle {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  padding: .25rem .5rem; font: inherit; font-size: .75rem; font-weight: 600;
  color: var(--primary); background: none; border: 0; border-radius: .5rem; cursor: pointer;
}
.lg-toggle:hover { background: rgba(46,139,87,.1); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.lg-toggle:focus-visible, .lg-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.lg-submit {
  display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
  padding: .875rem 1rem; font: inherit; font-size: .875rem; font-weight: 700;
  color: var(--text-on-dark); background: var(--primary); border: 0; border-radius: .75rem; cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(15,23,42,.15), 0 4px 6px -4px rgba(15,23,42,.15);
  transition: background .15s, box-shadow .15s;
}
.lg-submit:hover { background: var(--secondary); }
.lg-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(46,139,87,.25);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent);
}
.lg-submit:disabled { opacity: .7; cursor: progress; }

/* ---- "ask admin for access" */
.lg-help { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid #f1f5f9; text-align: center; }
.lg-help p { margin: 0; font-size: .875rem; color: #64748b; }
.lg-link {
  margin-top: .25rem; padding: .15rem .25rem; font: inherit; font-size: .875rem; font-weight: 600;
  color: var(--primary); background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.lg-link:hover { color: var(--secondary); }
.lg-foot { margin: 1.25rem 0 0; font-size: .75rem; color: #94a3b8; text-align: center; }
.lg-body.has-bg .lg-foot { color: rgba(255,255,255,.8); }

.lg-dialog {
  width: calc(100% - 2rem); max-width: 24rem; padding: 0; color: #0f172a;
  border: 1px solid #e2e8f0; border-radius: 1rem; box-shadow: 0 25px 50px -12px rgba(15,23,42,.35);
}
.lg-dialog::backdrop { background: rgba(15, 23, 42, .6); }
.lg-dialog-inner { padding: 1.5rem; }
.lg-dialog h2 { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--secondary); }
.lg-dialog p { margin: .5rem 0 0; font-size: .875rem; line-height: 1.6; color: #475569; }
.lg-dialog button {
  width: 100%; margin-top: 1.5rem; padding: .75rem 1rem; font: inherit; font-size: .875rem; font-weight: 600;
  color: var(--text-on-dark); background: var(--primary); border: 0; border-radius: .75rem; cursor: pointer;
}
.lg-dialog button:hover { background: var(--secondary); }

@media (max-width: 480px) {
  .lg-main { padding: 1rem .75rem; }
  .lg-head { padding: 1.75rem 1.5rem 2rem; }
  .lg-welcome { margin-top: 1.75rem; }
  .lg-pad { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Same reason as in app.css: 16px fields stop iOS zooming the page when you tap into one. */
@media (max-width: 899px) {
  .lg-input-wrap input { font-size: 1rem; }
}
