/* ===========================================================
   Auth.css
   Simple centered-card styles for the LedgerFlow login &
   signup pages, matching the rest of the app's theme.
=========================================================== */

.auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  padding: 24px 16px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 22px;
  padding: 38px 34px 32px;
  box-shadow: 0 18px 40px rgba(30, 41, 59, 0.1);
  box-sizing: border-box;
}

.auth-card-compact {
  padding: 26px 30px 22px;
}

.auth-card-compact .auth-brand {
  margin-bottom: 14px;
}

.auth-card-compact .auth-brand-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}

.auth-card-compact .auth-brand-title {
  font-size: 22px;
}

.auth-card-compact .auth-form-header {
  margin-bottom: 14px;
}

.auth-card-compact .auth-form-heading {
  font-size: 22px;
  margin-bottom: 4px;
}

.auth-card-compact .auth-form-subtext {
  font-size: 13.5px;
}

.auth-card-compact .auth-form {
  gap: 11px;
}

.auth-card-compact .auth-field {
  gap: 5px;
}

.auth-card-compact .auth-input-wrap {
  height: 54px;
}

.auth-card-compact .auth-switch {
  margin-top: 14px;
}

/* ---------- Brand ---------- */

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-brand-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #2540d6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(37, 64, 214, 0.28);
}

.auth-brand-logo-icon svg {
  color: #ffffff;
}

.auth-brand-text {
  text-align: left;
}

.auth-brand-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.auth-brand-subtitle {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 3px;
}

/* ---------- Form header ---------- */

.auth-form-header {
  margin-bottom: 24px;
}

.auth-form-heading {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
}

.auth-form-subtext {
  font-size: 14.5px;
  color: #64748b;
  margin: 0;
}

/* ---------- Form ---------- */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #0f172a;
  text-transform: uppercase;
  text-align: left;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #eef1f7;
  border-radius: 14px;
  padding: 0 15px;
  height: 58px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-input-wrap:focus-within {
  border-color: #2540d6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 64, 214, 0.12);
}

.auth-input-icon {
  color: #9aa3b5;
  flex-shrink: 0;
  margin-right: 10px;
}

.auth-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: #1f2430;
  height: 100%;
  min-width: 0;
}

.auth-input::placeholder {
  color: #a9b0c0;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1f2430;
  -webkit-box-shadow: 0 0 0 1000px #eef1f7 inset;
  box-shadow: 0 0 0 1000px #eef1f7 inset;
  caret-color: #1f2430;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-input-wrap:focus-within .auth-input:-webkit-autofill,
.auth-input-wrap:focus-within .auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
}

.auth-input-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9aa3b5;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.auth-input-toggle:hover {
  color: #2540d6;
}

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

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #475569;
  cursor: pointer;
}

.auth-remember input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 17px;
  height: 17px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-remember input:hover {
  border-color: #94a3b8;
}

.auth-remember input:checked {
  background: #2540d6;
  border-color: #2540d6;
}

.auth-remember input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-link {
  font-size: 13.5px;
  font-weight: 600;
  color: #2540d6;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 16px;
  background: #2540d6;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37, 64, 214, 0.25);
  transition: background 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

.auth-btn:hover {
  background: #1f35b8;
}

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

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: #64748b;
}

.auth-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

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

@media (max-width: 420px) {
  .auth-card {
    border-radius: 16px;
    padding: 28px 20px 24px;
  }
}
