/* Family1st Desktop Login UI */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1F2933;
  background: #F6F9FC;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
}

.brand-panel, .form-panel { min-width: 0; }

input, button, textarea, select { font-family: inherit; }

a { color: inherit; }
.link {
  color: #2A89C1;
  text-decoration: none;
  font-weight: 500;
}
.link:hover { text-decoration: underline; }
.link.small { font-size: 13px; }
.muted { color: #6B7785; font-size: 14px; margin-right: 8px; }

/* ======== Layout ======== */
.page {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

/* ======== Brand panel (left) ======== */
.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 56px 0;
  background:
    radial-gradient(800px 500px at 10% 10%, #E5EFFB 0%, transparent 60%),
    linear-gradient(180deg, #DCE9F7 0%, #CFE0F2 100%);
  overflow: hidden;
}

.brand-top {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 200px;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.brand-copy {
  margin-top: 56px;
  max-width: 520px;
}

.brand-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 2.5vw, 40px);
  line-height: 1.2;
  font-weight: 700;
  color: #16345A;
  letter-spacing: -0.5px;
}

.brand-copy p {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.6;
  color: #3D5573;
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #1F3550;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6);
}
.dot-blue   { background: #3FA1D5; }
.dot-yellow { background: #F2C744; }
.dot-green  { background: #8FBF3A; }

.brand-illustration {
  margin-top: auto;
  margin-left: -40px;
  margin-right: -40px;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.brand-illustration img {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* Mobile-only logo band at top of form-panel (REQ-004) */
.mobile-brand-top { display: none; }

/* ======== Form panel (right) ======== */
.form-panel {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  padding: 28px 48px 24px;
  position: relative;
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.form-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-card {
  width: 100%;
  max-width: 420px;
  padding: 8px 0;
}

.form-card h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  color: #14233A;
  letter-spacing: -0.3px;
}

.form-card .sub {
  margin: 0 0 28px;
  font-size: 14px;
  color: #6B7785;
}

/* ======== Form fields ======== */
.login-form {
  display: flex;
  flex-direction: column;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3D4A5C;
  margin: 0 0 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
}

.field {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid #D7DEE7;
  border-radius: 10px;
  padding: 0 12px;
  background: #FFFFFF;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field:focus-within {
  border-color: #3FA1D5;
  box-shadow: 0 0 0 3px rgba(63, 161, 213, 0.18);
}

.field-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  flex: 0 0 auto;
}

.field-input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #1F2933;
  height: 100%;
  min-width: 0;
}

.field-input::placeholder {
  color: #9AA5B4;
}

.toggle-pw {
  background: none;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5B6573;
  flex: 0 0 auto;
}

/* ======== Remember me ======== */
.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 22px;
  font-size: 14px;
  color: #3D4A5C;
  cursor: pointer;
  user-select: none;
}

.remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1.5px solid #B5C0CE;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  transition: all 0.15s ease;
  flex: 0 0 auto;
}

.remember input:checked + .checkmark {
  background: #3FA1D5;
  border-color: #3FA1D5;
}

.remember input:checked + .checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ======== Sign In ======== */
.signin-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(180deg, #5BB4E5 0%, #3FA1D5 100%);
  color: #FFFFFF;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(63, 161, 213, 0.30);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.signin-btn:hover {
  box-shadow: 0 8px 18px rgba(63, 161, 213, 0.40);
}

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

.support {
  margin: 20px 0 0;
  font-size: 13px;
  color: #6B7785;
  text-align: center;
}

/* ======== Footer ======== */
.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  font-size: 13px;
  color: #8A95A4;
  border-top: 1px solid #EEF2F6;
}

.footer-links {
  display: flex;
  gap: 22px;
}

/* ======== Responsive ======== */
@media (max-width: 1080px) {
  .brand-copy { margin-top: 36px; }
  .brand-copy h1 { font-size: 28px; }
  .brand-panel { padding: 32px 40px 0; }
  .form-panel { padding: 24px 36px; }
}

@media (max-width: 880px) {
  .page {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    padding: 28px 32px 0;
    min-height: 360px;
  }
  .brand-copy { max-width: none; margin-top: 24px; }
  .brand-copy h1 { font-size: 24px; }
  .brand-illustration { margin-top: 24px; margin-left: 0; margin-right: 0; }
  .brand-illustration img { max-height: 240px; object-fit: contain; }
  .form-panel { padding: 28px 28px 20px; }
  .top-nav { display: none; }
  .page-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .brand-panel { display: none; }
  .mobile-brand-top {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px 16px 10px;
  }
  .mobile-brand-top img {
    width: 160px;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
  }
  .form-panel { padding-top: 8px; }
}

@media (max-width: 520px) {
  .form-panel { padding: 24px 20px 16px; }
  .form-card h2 { font-size: 24px; }
  .features li { font-size: 14px; }
}

@media (max-width: 360px) {
  .brand-panel { padding: 24px 18px 0; min-height: 280px; }
  .brand-logo { width: 160px; }
  .brand-copy h1 { font-size: 22px; }
  .brand-copy p { font-size: 14px; }
  .features li { font-size: 13px; }
  .brand-illustration img { max-height: 180px; }
  .form-panel { padding: 20px 16px 14px; }
  .form-card h2 { font-size: 22px; }
  .form-card .sub { font-size: 13px; }
  .field { height: 44px; padding: 0 10px; }
  .field-input { font-size: 14px; }
  .signin-btn { height: 44px; font-size: 14px; }
  .support { font-size: 12px; }
  .app-badges { gap: 0.5rem; }
  .mobile-brand-top { padding: 14px 12px 8px; }
  .mobile-brand-top img { width: 140px; }
}

/* ======== Inline FA eye icon styling (replaces the new UI's toggle-pw SVG button) ======== */
.iconcontent {
  cursor: pointer;
  color: #5B6573;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 16px;
  user-select: none;
}
.iconcontent:hover { color: #2A89C1; }

/* ======== Inline error message (used by main.js for invalid credentials) ======== */
.err {
  display: block;
  color: #d23;
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

/* ======== Forgot Password modal (Bootstrap markup, restyled for new UI design language) ======== */
.f1-modal .modal-dialog {
  margin-top: 80px;
}
.f1-modal .modal-content {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 12px;
  border: none;
  box-shadow: 0 20px 60px rgba(20, 35, 58, 0.25);
}
.f1-modal .modal-header {
  border-bottom: 1px solid #EEF2F6;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.f1-modal .modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #14233A;
  letter-spacing: -0.2px;
}
.f1-modal .modal-body {
  padding: 22px;
}
.f1-modal .modal-body .field-label {
  margin-bottom: 8px;
}
.f1-modal .modal-body .field-input {
  width: 100%;
  height: 44px;
  border: 1px solid #D7DEE7;
  border-radius: 10px;
  padding: 0 12px;
  background: #FFFFFF;
  font-size: 15px;
  color: #1F2933;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.f1-modal .modal-body .field-input:focus {
  border-color: #3FA1D5;
  box-shadow: 0 0 0 3px rgba(63, 161, 213, 0.18);
}
.f1-modal .pChangePwdResult {
  color: #d23;
  font-size: 13px;
  margin: 10px 0 0;
  min-height: 18px;
}
.f1-modal .modal-footer {
  border-top: 1px solid #EEF2F6;
  padding: 14px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.f1-modal .modal-footer .signin-btn {
  width: auto;
  min-width: 110px;
  height: 40px;
  padding: 0 18px;
  box-shadow: 0 4px 10px rgba(63, 161, 213, 0.30);
}
.f1-modal .btn-secondary-new {
  background: #FFFFFF;
  border: 1px solid #D7DEE7;
  color: #3D4A5C;
  border-radius: 10px;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.f1-modal .btn-secondary-new:hover {
  background: #F6F9FC;
  border-color: #B5C0CE;
}
.f1-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #6B7785;
  opacity: 0.7;
  cursor: pointer;
  padding: 0 4px;
}
.f1-modal-close:hover { opacity: 1; color: #14233A; }

/* App store badges below the support link in the form card (REQ-002) */
.app-badges {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    align-items: center;
}
.app-badges a {
    flex: 1 1 0;
    min-width: 0;
    display: block;
    line-height: 0;
}
.app-badges img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}
