/* ==========================================================================
   1. CSS Reset & Base Variables
   ========================================================================== */
:root {
  --primary-blue: #0060a9;
  --primary-blue-hover: #004b85;
  --text-dark: #333333;
  --text-muted: #5c5c5c;
  --error-red: #b31010;
  --border-color: #cccccc;
  --white: #ffffff;
  --font-stack: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-stack);
  color: var(--text-dark);
  background-color: #f4f4f4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   2. Header Styles (Updated for logo_chase_wht.webp)
   ========================================================================== */
.main-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: center;
  /* A subtle gradient overlay guarantees the white WebP logo stays highly legible against lighter clouds */
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0) 100__
  );
}

.chase-logo {
  width: 100%;
  max-width: 160px;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ==========================================================================
   3. Main Container & Background Graphic
   ========================================================================== */
.hero-container {
  flex: 1;
  min-height: 80vh;
  position: relative;
  /* Updated path to use forward slashes for universal browser compatibility */
  background: url("../img/new_york_night_6.webp") no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem 3rem 1rem;
}
/* ==========================================================================
   4. Login Card Component
   ========================================================================== */
.login-card,
.account-card {
  background: var(--white);
  width: 100%;
  max-width: 400px;
  border-radius: 4px;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 5;
}

.input-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: bold;
  color: #5c0632; /* Matches the dark-red tint text color in screenshot */
  margin-bottom: 0.35rem;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="tel"],
.input-group input[type="Number"],
.input-group input[type="date"] {
  width: 100%;
  padding: 0.5rem 0;
  font-size: 1rem;
  border: none;
  border-bottom: 1px solid var(--border-color);
  outline: none;
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  border-bottom: 2px solid var(--primary-blue);
}

/* Error UI State styling */
.input-group.error label {
  color: var(--error-red);
}

.input-group.error input {
  border-bottom: 1px solid var(--error-red);
}

.error-message {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--error-red);
  margin-top: 0.5rem;
}

/* Password eye container style */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.toggle-password-btn {
  position: absolute;
  right: 0;
  background: none;
  border: none;
  color: var(--primary-blue);
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
}

/* Checkboxes Styling */
.options-group {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
}

.checkbox-container {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  gap: 0.5rem;
}

/* Buttons Styling */
.btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: var(--white);
  border: none;
}

.btn-primary:hover {
  background-color: var(--primary-blue-hover);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
  margin-right: 0.5em;
}
.divider:not(:empty)::after {
  margin-left: 0.5em;
}

.btn-secondary {
  background-color: var(--white);
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

.btn-secondary:hover {
  background-color: rgba(0, 96, 169, 0.05);
}

/* Links */
.form-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-link i {
  font-size: 0.75rem;
}

/* ==========================================================================
   5. Footer Layout Styling
   ========================================================================== */
.main-footer {
  background-color: #ffffff;
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.social-icons a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.social-icons a:hover {
  color: var(--text-dark);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
}

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.5;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   6. Responsive Layout Breakpoints
   ========================================================================== */
@media (max-width: 480px) {
  /* Slightly shrinks the WebP logo bounds on modern compact smart screen viewports */
  .chase-logo {
    max-width: 130px;
  }
}

@media (min-width: 768px) {
  /* Center positioning transformations for tablets */
  .hero-container {
    padding: 0 2rem;
  }
}

@media (min-width: 1024px) {
  /* Shifts card to align closely with right-of-center placement on desktop */
  .hero-container {
    justify-content: center; /* Adjust to flex-end if you prefer it perfectly right-aligned */
  }

  .login-car,
  .account-cardd {
    max-width: 420px;
  }

  .footer-links {
    justify-content: center;
  }
}

.top-error {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 16px;
    border-radius: 8px;
    z-index: 9999;
    transition: top 0.5s ease-in-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.top-error.show {
    top: 20px;
}

.spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

#Passwordless.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button.loading .btn-text {
    display: none;
}

button.loading .spinner {
    display:block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}