/* LetWorkBeDone - Login page | Brand green #00664e */

:root {
  --brand: #00664e;
  --brand-dark: #00523f;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f4f7f6;
  --card: #ffffff;
  --input-bg: #f1f5f9;
  --input-border: #9ca3af;
  --card-border: #e5e7eb;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --error-border: #fecaca;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --success-border: #a7f3d0;
}

*, *::before, *::after { box-sizing: border-box; }

body.login-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  padding: 16px;
  -webkit-text-size-adjust: 100%;
}

/* margin:auto centers the card when there is room,
   and lets it scroll normally on phones when it is taller than the screen */
.login-wrap {
  width: 100%;
  margin: auto;
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 16px;
  padding: 26px 26px 22px;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px -12px rgba(0, 102, 78, 0.18);
}

/* Header */
.login-header { text-align: center; margin-bottom: 18px; }

.brand-logo {
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 50%;
}

.login-header h1 {
  margin: 0 0 2px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sub { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Messages */
.login-msg {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.login-msg.error   { background: var(--error-bg);   color: var(--error-text);   border-color: var(--error-border); }
.login-msg.success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }

/* Form */
.login-form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  outline: none;
}

.field input::placeholder { color: #94a3b8; }
.field input:focus { background: #fff; box-shadow: none; }

/* Password eye button */
.pass-wrap { position: relative; }
.pass-wrap input { width: 100%; padding-right: 42px; }

.eye-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.eye-btn:hover, .eye-btn.active { color: var(--brand); background: #f1f5f9; }
.eye-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Button */
.login-btn {
  margin-top: 4px;
  height: 44px;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--brand-dark); }
.login-btn:active { transform: scale(0.99); }
.login-btn:focus-visible { outline: 3px solid rgba(0, 102, 78, 0.25); outline-offset: 2px; }

/* Footer */
.login-footer { margin: 16px 0 0; text-align: center; font-size: 0.88rem; color: var(--muted); }
.login-footer a { color: var(--brand); font-weight: 600; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* Phones */
@media (max-width: 480px) {
  body.login-page { padding: 10px; }
  .login-card { padding: 18px 16px 16px; border-radius: 14px; }
  .brand-logo { width: 44px; height: 44px; margin-bottom: 6px; }
  .login-header { margin-bottom: 12px; }
  .login-header h1 { font-size: 1.15rem; }
  .sub { display: none; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f1f5f9;
    --muted: #94a3b8;
    --bg: #0b1412;
    --card: #111b18;
    --input-bg: #0f1a17;
    --input-border: #4b5563;
    --card-border: #1e293b;
  }
  .field label { color: #cbd5e1; }
  .field input:focus { background: #0f1a17; }
  .eye-btn:hover, .eye-btn.active { background: #1e293b; }
  .login-msg.error   { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
  .login-msg.success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
}