/* ======================================
   AMERICAN-CREST BANK
   Login Page Styles (with Light/Dark Mode)
====================================== */

:root {
  /* Dark theme (default) */
  --bg: #0b1220;
  --panel: #101b2d;
  --card: #152238;
  --card-hover: #1b2c45;
  --primary: #0789e8;
  --primary-light: #24a4ff;
  --text: #f3f7fc;
  --muted: #98a9bf;
  --border: rgba(255, 255, 255, 0.09);
  --input-bg: #0c1727;
  --input-border: #293a51;
  --success: #35c99a;
  --danger: #ff7474;
  --topbar-bg: rgba(8, 15, 28, 0.96);
  --shadow: 0 20px 70px #0002;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --card: #ffffff;
  --card-hover: #f8fafc;
  --primary: #0789e8;
  --primary-light: #0077d4;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.1);
  --input-bg: #f8fafc;
  --input-border: #e2e8f0;
  --topbar-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at top left, #102d4b 0%, transparent 38%),
    var(--bg);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="light"] body {
  background:
    radial-gradient(ellipse at top left, #dbeafe 0%, transparent 40%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

/* TOPBAR */

.topbar {
  height: 72px;
  padding: 0 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.brand-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #0875cf, #20a5ff);
  color: white;
  font-size: 18px;
}

/* Theme Toggle Button */
.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 17px;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}

/* LOGIN WRAPPER */

.login-wrapper {
  width: min(480px, 92%);
  margin: 40px auto 60px;
  padding-bottom: 40px;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* HEADER */

.login-header {
  text-align: center;
  margin-bottom: 8px;
}

.logo-circle {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #0875cf, #20a5ff);
  color: white;
  font-size: 28px;
  box-shadow: 0 10px 30px #0789e830;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--muted);
  font-size: 13px;
}

/* CREDENTIALS CARD */

.credentials-card {
  padding: 32px 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.credentials-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 26px;
  text-align: center;
}

/* FORM */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.label-row label {
  margin-bottom: 0;
}

.forgot-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  transition: 0.2s ease;
}

.forgot-link:hover {
  text-decoration: underline;
}

.input-wrap {
  position: relative;
}

.input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
  z-index: 2;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  outline: none;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  transition: 0.25s ease;
}

.input-wrap input::placeholder {
  color: var(--muted);
}

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 137, 232, 0.15);
}

.input-wrap input.invalid {
  border-color: var(--danger);
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 4px;
  z-index: 2;
  transition: 0.2s ease;
}

.toggle-password:hover {
  color: var(--primary);
}

.field-error {
  display: block;
  margin-top: 5px;
  color: var(--danger);
  font-size: 11px;
  min-height: 0;
}

.field-error:empty {
  display: none;
}

/* CHECKBOX */

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 12px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.check-row label {
  cursor: pointer;
  user-select: none;
  color: var(--text);
}

/* BUTTONS */

.btn {
  min-height: 48px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  transition: 0.25s ease;
}

.btn-primary {
  color: white;
  background: linear-gradient(120deg, #087bdb, #079cf3);
  box-shadow: 0 6px 20px rgba(7, 137, 232, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(7, 137, 232, 0.35);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--input-border);
}

.btn-secondary:hover {
  background: var(--card-hover);
  border-color: var(--muted);
}

.full-btn {
  width: 100%;
}

/* DIVIDER */

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  white-space: nowrap;
}

/* FOOTER */

.login-footer {
  text-align: center;
  margin-top: 10px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 14px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  transition: 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-links i {
  font-size: 12px;
}

.privacy-text {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto;
}

/* MOBILE */

@media (max-width: 600px) {
  .topbar {
    height: 64px;
    padding: 0 18px;
  }

  .brand {
    font-size: 13px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .login-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .login-card {
    gap: 0;
  }

  .login-header {
    padding: 28px 20px 10px;
  }

  .logo-circle {
    width: 60px;
    height: 60px;
    font-size: 24px;
    margin-bottom: 14px;
  }

  .login-header h1 {
    font-size: 24px;
  }

  .credentials-card {
    margin: 0 16px;
    padding: 26px 20px;
    border-radius: 16px;
  }

  .credentials-card h2 {
    font-size: 17px;
  }

  .input-wrap input {
    height: 50px;
    font-size: 14px;
  }

  .login-footer {
    padding: 24px 20px 40px;
  }

  .footer-links {
    gap: 18px;
  }
}

@media (max-width: 380px) {
  .credentials-card {
    margin: 0 12px;
    padding: 22px 16px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 12px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}