@import url('variables.css');

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--fl-gradient);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-left {
  background: var(--fl-navy-deep);
  color: var(--fl-white);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
}
.login-left .back {
  align-self: flex-start;
  color: var(--fl-muted);
  text-decoration: none;
  border: 1px solid rgba(189,204,223,0.35);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
}
.badge {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.4rem 1rem;
  background: rgba(81,200,239,0.15);
  color: var(--fl-cyan);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.login-left h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin: 1.5rem 0 0.5rem; }
.login-left h1 span { color: var(--fl-cyan); }
.login-lede { color: #bdccdf; margin: 0 0 1rem; }
.login-intro { color: #bdccdf; line-height: 1.6; max-width: 420px; margin: 0; }
.tiles { display: grid; gap: 0.75rem; margin: 2rem 0; }
.tile {
  border: 1px solid rgba(189,204,223,0.3);
  border-radius: var(--fl-radius-sm);
  padding: 1rem 1.25rem;
  color: var(--fl-muted);
  font-size: 0.95rem;
}
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, rgba(7,22,41,0.3), rgba(7,22,41,0.6));
}
.login-card {
  width: min(440px, 100%);
  background: var(--fl-white);
  border-radius: 30px;
  padding: 2.25rem;
  box-shadow: var(--fl-shadow);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #123456, #51c8ef);
}
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--fl-text-navy); }
.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--fl-border);
  border-radius: 12px;
  padding: 0 0.75rem;
}
.input-wrap input {
  flex: 1;
  border: none;
  padding: 0.75rem 0.5rem;
  min-height: 48px;
  font-size: 1rem;
  outline: none;
  background: transparent;
}
.input-wrap:focus-within { border-color: #1d70d5; box-shadow: 0 0 0 3px rgba(29, 112, 213, 0.2); }
.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.icon-btn:focus-visible { outline: 2px solid #1d70d5; outline-offset: 2px; }
.input-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-color: #5a7089;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}
.input-icon--mail {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' d='M4 6h16v12H4z'/%3E%3Cpath stroke-linecap='round' d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' d='M4 6h16v12H4z'/%3E%3Cpath stroke-linecap='round' d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
}
.input-icon--lock {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 118 0v3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 118 0v3'/%3E%3C/svg%3E");
}
.input-icon--eye {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.tile-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  vertical-align: -3px;
  background: var(--fl-cyan);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
}
.tile-icon--check {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11'/%3E%3C/svg%3E");
}
.tile-icon--shield {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
}
.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 0.75rem;
}
.auth-logo-full {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.auth-logo-full--compact { margin-bottom: 0.25rem; }
.card-title { margin: 0.5rem 0 0.25rem; color: var(--fl-text-navy); font-size: 1.65rem; }
.card-sub { margin: 0 0 1.25rem; }
.foot-note { margin-top: 1.25rem; }
.link-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-align: left;
  margin-top: 0.35rem;
}
.contact-panel {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f1f6fb;
  border-radius: 12px;
  border: 1px solid var(--fl-border);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5a7089;
}
.remember { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.field { margin-bottom: 1rem; }
.field-error { min-height: 1.1rem; margin-top: 0.35rem; font-size: 0.85rem; }
.recovery-body { background: var(--fl-gradient); }
.recovery-shell {
  min-height: 100vh;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.recovery-back { align-self: flex-start; max-width: 480px; width: 100%; color: #e8f0fa; text-decoration: none; margin-bottom: 1rem; }
.recovery-card { width: min(480px, 100%); }
.recovery-step { display: none; }
.recovery-step.active { display: block; }
.recovery-link { display: inline-block; margin-top: 1rem; }
.recovery-channel-group {
  border: 1px solid var(--fl-border, #d8e2ed);
  border-radius: 12px;
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem 0.75rem;
  background: #f9fbfd;
}
.recovery-channel-legend {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fl-text-navy, #0b2545);
  line-height: 1.35;
}
.recovery-channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.recovery-card .recovery-channel-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 400;
  color: var(--fl-text-navy, #0b2545);
}
.recovery-card .recovery-channel-option:hover {
  background: rgba(29, 112, 213, 0.06);
}
.recovery-card .recovery-channel-option:has(input:checked) {
  background: rgba(29, 112, 213, 0.1);
}
.recovery-card .recovery-channel-option input[type='radio'] {
  margin: 0.15rem 0 0;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: #1d70d5;
}
.recovery-channel-option__body {
  display: block;
  flex: 1;
  min-width: 0;
}
.recovery-channel-option__title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
}
.recovery-channel-option__hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.recovery-card .recovery-step[data-step='1'] .field {
  margin-top: 0.15rem;
}
.recovery-field--hidden {
  display: none !important;
}
/* Channel field swap without JS (matches syncChannelFields). */
.recovery-step[data-step='1']:has(#chEmail:checked) #fieldPhone {
  display: none !important;
}
.recovery-step[data-step='1']:has(#chSms:checked) #fieldEmail {
  display: none !important;
}
.recovery-step[data-step='1']:has(#chSms:checked) #fieldPhone.recovery-field--hidden {
  display: block !important;
}
.recovery-step[data-step='1'] .form-error--step1 {
  margin: 0.35rem 0 0.15rem;
  min-height: 1.25rem;
}
.input-icon--phone {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235a7089' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
.step-pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5a7089;
  background: #f1f6fb;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin: 0 0 0.35rem;
}
.pw-req { font-size: 0.85rem; margin: -0.25rem 0 0.75rem; }
.btn-submit {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  background: var(--fl-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn-submit:disabled { opacity: 0.6; cursor: wait; }
.form-error { color: #c62828; font-size: 0.9rem; min-height: 1.25rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; margin-bottom: 1rem; }
.muted { color: #5a7089; font-size: 0.85rem; line-height: 1.5; }
.link { color: #1d70d5; text-decoration: none; }
.link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { min-height: auto; }
}
