/* Layout: center content and provide generous spacing on all screens */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  min-height: calc(100vh - 160px); /* header + safe space */
}

.login-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header */
.login-header { text-align: center; display: grid; gap: 6px; }
.login-title { margin: 0; font-size: 1.6rem; font-weight: 800; color: #fff; }
.login-subtitle { color: var(--muted); font-size: 0.95rem; }

/* Error */
.login-error {
  background: rgba(239,68,68,0.12);
  color: #fecaca;
  border: 1px solid rgba(239,68,68,0.35);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

/* Form */
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-row { display: flex; flex-direction: column; gap: 6px; }

.login-input {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(17,24,39,0.65);
  color: var(--text);
  padding: 14px 14px;
  font-size: 16px; /* larger for mobile tap/legibility */
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.login-input::placeholder { color: rgba(255,255,255,0.6); }
.login-input:focus {
  outline: none;
  border-color: rgba(99,102,241,0.7);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

/* Password toggle */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.toggle-password:hover {
  background: rgba(255,255,255,0.12);
}

/* Actions */
.login-actions {
  margin-top: 6px;
  display: flex;
  justify-content: center;
}
.login-submit {
  border-radius: 10px;
}

.auth-switch {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-switch a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 700;
}

.auth-switch a:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

.field-help {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.password-rules {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.password-rules li {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 6px;
}

.password-rules li::before {
  content: "•";
  color: #64748b;
  font-weight: 700;
}

.password-rules li.ok {
  color: #86efac;
}

.password-rules li.ok::before {
  content: "✓";
  color: #22c55e;
}

.agreement-box {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
  border-radius: 10px;
  padding: 12px;
}

.agreement-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.45;
}

.agreement-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #6366f1;
}

.agreement-row a {
  color: #93c5fd;
  text-decoration: underline;
}

/* ---------- Responsive Tweaks ---------- */

/* Small phones */
@media (max-width: 360px) {
  .login-card { padding: 22px 16px; }
  .login-title { font-size: 1.4rem; }
  .login-input { font-size: 15px; padding: 12px 12px; }
  .toggle-password { padding: 5px 8px; font-size: 11px; }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1023px) {
  .login-container { min-height: calc(100vh - 220px); }
  .login-card { padding: 32px 28px; max-width: 520px; }
  .login-title { font-size: 1.8rem; }
}

/* Desktops (align with your other pages’ rhythm) */
@media (min-width: 1024px) {
  .login-container { min-height: calc(100vh - 240px); }
  .login-card { padding: 36px 32px; max-width: 560px; }
  .login-title { font-size: 2rem; }
}
