:root {
  --rf-red: #E3000F;
  --rf-navy: #002B5C;
  --rf-light-blue: #E6F0FA;
  --rf-surface: #F8F9FA;
  --rf-surface-strong: #FFFFFF;
  --rf-border: #DEE2E6;
  --rf-text: #212529;
  --rf-muted: #6C757D;
  --rf-success: #198754;
  --rf-warning: #FFC107;
  --rf-focus: #002B5C;
  --rf-error-bg: #FCE9EB;
  --rf-error-border: #F5A3AB;
}

[data-bs-theme="dark"] {
  --rf-surface: #121212;
  --rf-surface-strong: #1E1E1E;
  --rf-border: #2A2A2A;
  --rf-text: #EDEDED;
  --rf-muted: #B3B3B3;
  --rf-error-bg: #3A0F16;
  --rf-error-border: #8C1C25;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", "Open Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--rf-text);
  background: var(--rf-surface);
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  background: var(--rf-surface-strong);
  border: 1px solid var(--rf-border);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
  .auth-shell {
    padding: 48px;
  }

  .login-card {
    padding: 32px;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    padding: 16px;
  }

  .login-card {
    padding: 20px;
    border-radius: 14px;
  }

  .card-title {
    font-size: 1.75rem;
  }
}

.card-head {
  margin-bottom: 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rf-navy);
  margin: 0 0 8px;
}

[data-bs-theme="dark"] .brand {
  color: #7FA8FF;
}

.card-title {
  font-size: 2rem;
  margin: 1rem 0 0;
  color: var(--rf-text);
  text-align: center;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-brand img {
  height: 36px;
  display: block;
  margin: 0 auto;
}

.theme-toggle {
  border: 1px solid var(--rf-border);
  background: transparent;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--rf-navy);
  font-size: 1.1rem;
  align-self: center;
}

.theme-toggle:hover {
  background: rgba(0, 43, 92, 0.08);
}

html[data-bs-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

html[data-bs-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.status {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.status p {
  margin: 0;
}

.status-error {
  background: var(--rf-error-bg);
  border-color: var(--rf-error-border);
  color: var(--rf-red);
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--rf-text);
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  border: 1px solid var(--rf-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  background: transparent;
  color: var(--rf-text);
  min-height: 48px;
}

.form-group input:focus,
.checkbox input:focus {
  outline: 2px solid var(--rf-focus);
  outline-offset: 2px;
}

.field-error {
  font-size: 0.9rem;
  color: var(--rf-red);
  margin-top: 4px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  padding: 6px 0;
}

.checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--rf-navy);
  flex-shrink: 0;
}

.checkbox span {
  color: var(--rf-text);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-primary {
  border: none;
  border-radius: 999px;
  background: var(--rf-red);
  color: #fff;
  height: 48px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: #b9000c;
}

.btn-primary:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -2px;
  box-shadow: 0 0 0 3px rgba(0, 43, 92, 0.6);
}

.btn-primary:active {
  transform: translateY(1px);
}

.secondary-link {
  text-align: center;
  color: var(--rf-navy);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.secondary-link[aria-disabled="true"],
.secondary-link.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none;
}

[data-bs-theme="dark"] .secondary-link {
  color: #86B7FF;
}

.login-footer {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--rf-muted);
  text-align: center;
}

.login-footer a {
  color: var(--rf-navy);
  text-decoration: underline;
}

[data-bs-theme="dark"] .login-footer a {
  color: #86B7FF;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.input-icon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--rf-border);
  border-radius: 10px;
  background: transparent;
  padding-left: 14px;
  min-height: 48px;
}

.input-icon i {
  color: var(--rf-muted);
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  margin-right: 10px;
}

.input-icon input {
  flex: 1;
  border: none !important;
  padding: 12px 14px 12px 0;
  background: transparent;
  outline: none;
  min-height: auto;
}

.input-icon:focus-within {
  outline: 2px solid var(--rf-focus);
  outline-offset: 2px;
}

.input-icon input:focus {
  outline: none !important;
}

.theme-toggle[data-theme="dark"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
