/* ================================================================
   Login Page - Ascend Capital Bank
   ================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background-color: #003b5c;
  overflow: auto;
  -webkit-font-smoothing: antialiased;
}

/* ═══ Wrapper ═══ */
.wrapper {
  display: flex;
  height: 100%;
  min-height: 100vh;
}

/* ═══ Left Panel ═══ */
.left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(160deg, #002030 0%, #003b5c 40%, #004f6d 100%);
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  min-width: 420px;
}

/* Decorative glow */
.left-panel::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -40%;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(43, 188, 179, 0.12) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.left-panel .logo {
  width: 200px;
  margin-bottom: 2rem;
  filter: brightness(0) invert(1);
  position: relative;
}

.handshake-container {
  position: relative;
  margin: 1rem 0;
}

.handshake {
  width: 260px;
  filter: brightness(0) invert(1);
  opacity: 0.3;
}

.left-panel .content {
  text-align: center;
  position: relative;
}

.headline {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

.back-to-home {
  position: absolute;
  top: 2rem;
  left: 2rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.back-to-home:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ═══ Right Panel / Container ═══ */
.container {
  flex: 1;
  min-width: 315px;
  min-height: 600px;
  max-width: 100%;
  height: 100%;
  background: #f4f7fa;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ═══ Login Form Card ═══ */
.login-form {
  flex: 1;
  margin: auto;
  width: 80%;
  max-width: 480px;
  min-width: 320px;
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 59, 92, 0.08);
  padding: 3rem 2rem;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Top accent bar */
.login-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #003b5c, #2bbcb3);
}

.login-form p {
  font-size: 0.875rem;
  color: #4a6274;
  text-align: center;
  margin-top: 1rem;
}

.login-form h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a2b3c;
  margin-bottom: 1.5rem;
}

/* ═══ Login Steps ═══ */
.login-step {
  display: none;
}

.login-step.active {
  display: block;
  animation: stepFadeIn 0.4s ease-out;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══ Step Icon ═══ */
.step-icon {
  text-align: center;
  margin-bottom: 1rem;
}

.icon-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #003b5c, #2bbcb3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(43, 188, 179, 0.3);
}

.icon-circle i {
  font-size: 1.6rem;
  color: #fff;
}

.icon-circle-2fa {
  background: linear-gradient(135deg, #2bbcb3, #003b5c);
}

/* ═══ Alerts ═══ */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  animation: fadeInAlert 0.4s ease-out;
}

@keyframes fadeInAlert {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-danger i {
  margin-right: 6px;
}

/* ═══ Form ═══ */
form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a2b3c;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  color: #1a2b3c;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: #2bbcb3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 188, 179, 0.15);
}

/* ═══ Password Field with Toggle ═══ */
.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1rem;
  font-size: 0.95rem;
  color: #1a2b3c;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
}

.password-field input:focus {
  outline: none;
  border-color: #2bbcb3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 188, 179, 0.15);
}

.toggle-pw-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s;
}

.toggle-pw-btn:hover {
  color: #2bbcb3;
}

/* ═══ PIN Input Group ═══ */
.pin-input-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 1rem 0;
}

.pin-digit {
  width: 60px;
  height: 68px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #003b5c;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
  caret-color: #2bbcb3;
}

.pin-digit:focus {
  outline: none;
  border-color: #2bbcb3;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(43, 188, 179, 0.15);
  transform: translateY(-2px);
}

.pin-digit:not(:placeholder-shown) {
  border-color: #2bbcb3;
  background: #f0fffe;
}

/* ═══ 2FA Code Input Group ═══ */
.code-input-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 1rem 0;
}

.code-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #003b5c;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
  caret-color: #2bbcb3;
}

.code-digit:focus {
  outline: none;
  border-color: #2bbcb3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 188, 179, 0.15);
  transform: translateY(-2px);
}

.code-digit:not(:placeholder-shown) {
  border-color: #2bbcb3;
  background: #f0fffe;
}

.code-separator {
  font-size: 1.2rem;
  color: #cbd5e1;
  font-weight: 300;
  margin: 0 2px;
}

/* ═══ Links ═══ */
p a {
  color: #003b5c;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

p a:hover {
  color: #2bbcb3;
  text-decoration: underline;
}

/* ═══ Submit Button ═══ */
.btn {
  width: 100%;
  padding: 0.875rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #003b5c, #004f6d);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(43, 188, 179, 0.15),
    transparent
  );
  transition: left 0.5s ease;
}

.btn:hover {
  background: linear-gradient(135deg, #002e47, #003b5c);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 59, 92, 0.2);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(0);
}

.btn-text,
.btn-spinner {
  display: inline;
}

.btn-spinner i {
  font-size: 1.1rem;
}

.g-recaptcha {
  width: 100%;
}

/* ═══ Responsive ═══ */
@media (max-width: 700px) {
  .wrapper {
    flex-direction: column;
  }

  .left-panel,
  .container {
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  .left-panel {
    min-width: 100%;
    min-height: auto;
    padding: 2rem 1rem;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .handshake-container {
    max-width: 100%;
    min-width: 100%;
  }

  .handshake {
    width: 100%;
  }

  .login-form {
    all: unset;
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .pin-digit {
    width: 52px;
    height: 60px;
    font-size: 1.3rem;
  }

  .code-digit {
    width: 40px;
    height: 48px;
    font-size: 1.1rem;
  }

  .pin-input-group {
    gap: 8px;
  }

  .code-input-group {
    gap: 5px;
  }
}

/* ═══ Back to Login Button (PIN & 2FA Steps) ═══ */
.pin-back-link-container {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.pin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #003b5c;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.pin-back-link i {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.pin-back-link:hover {
  background: #f8fafc;
  border-color: #003b5c;
  color: #002e47;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 59, 92, 0.08);
}

.pin-back-link:hover i {
  transform: translateX(-3px);
}

.pin-back-link:active {
  transform: translateY(0);
  box-shadow: none;
}
