/* Auth UI — mobile layout matched to reference screenshot (AVO branding) */
:root {
  --bg-top: #d8f0ee;
  --bg-mid: #e8f7f5;
  --bg-bottom: #ffffff;
  --text: #0a1628;
  --muted: #6b7a88;
  --link: #4a4a4a;
  --accent: #13b5a2;
  --accent-hover: #0fa392;
  --whatsapp: #25d366;
  --field-bg: rgba(255, 255, 255, 0.72);
  --field-border: rgba(255, 255, 255, 0.95);
  --phone-max: 390px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(
    180deg,
    var(--bg-top) 0%,
    var(--bg-mid) 42%,
    var(--bg-bottom) 72%
  );
}

.auth-shell {
  min-height: 100%;
  display: flex;
  justify-content: center;
  padding: 10px 16px 28px;
  position: relative;
  overflow-x: hidden;
}

.auth-phone {
  width: min(var(--phone-max), 100%);
  position: relative;
  z-index: 1;
}

/* Skyscraper accent behind hero (screenshot) */
.auth-phone::before {
  content: "";
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 220px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background:
    linear-gradient(180deg, rgba(120, 170, 185, 0.5) 0%, rgba(120, 170, 185, 0.15) 100%),
    linear-gradient(90deg, transparent 42%, rgba(90, 140, 155, 0.25) 42%, rgba(90, 140, 155, 0.25) 58%, transparent 58%);
  clip-path: polygon(18% 100%, 18% 35%, 28% 12%, 72% 12%, 82% 35%, 82% 100%);
  filter: blur(0.5px);
}

/* —— Top bar —— */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #5fd4a8 0%, #13b5a2 45%, #2eb8e8 100%);
  box-shadow: 0 2px 8px rgba(19, 181, 162, 0.35);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.4);
  mix-blend-mode: screen;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: #3d4a56;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  color: #2e3a45;
}

.icon-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-btn:first-child {
  border: 1.5px solid rgba(20, 32, 42, 0.7);
  border-radius: 6px;
  width: 32px;
  height: 32px;
}

.icon {
  width: 17px;
  height: 17px;
  stroke-width: 1.75;
}

/* —— Hero —— */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
  padding: 0 2px;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.hero-left {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 4px;
}

.hero-left h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

.hero-left .choice {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.hero-ava {
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  margin-top: -4px;
  margin-right: -6px;
}

.hero-ava img {
  display: block;
  width: 108px;
  height: 108px;
  max-width: none;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 18px rgba(19, 181, 162, 0.22));
}

/* —— Form card —— */
.auth-card {
  padding: 0;
  position: relative;
  z-index: 2;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  margin: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.field .field-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  opacity: 0.5;
  color: #5a6570;
}

.field .field-ico--img {
  opacity: 1;
  object-fit: contain;
  display: block;
}

.field .field-ico--whatsapp {
  opacity: 1;
  color: var(--whatsapp);
}

.field input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
  padding: 13px 0;
}

.field input::placeholder {
  color: #8d98a4;
  font-size: 14px;
}

.field .suffix {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.password-toggle {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  color: #7a8794;
}

.password-toggle .icon {
  width: 20px;
  height: 20px;
  opacity: 0.55;
}

/* Agreement row */
.row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.row a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.row a:hover {
  text-decoration: underline;
}

.check {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  border-radius: 2px;
}

/* Primary button */
.btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  min-height: 50px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  box-shadow: none;
  cursor: pointer;
  margin-top: 6px;
}

.btn:hover {
  background: var(--accent-hover);
}

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

.switch {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--link);
}

.switch a {
  color: var(--link);
  text-decoration: none;
}

.switch a:hover {
  text-decoration: underline;
}

.download-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 25, 38, 0.55);
  backdrop-filter: blur(4px);
}

.download-overlay[hidden] {
  display: none !important;
}

.download-screen {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.18);
}

.download-topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(20, 34, 56, 0.08);
}

.download-close {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
}

.download-close svg {
  width: 20px;
  height: 20px;
}

.download-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.download-card {
  padding: 20px 18px 22px;
}

.download-copy {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}

.download-buttons {
  display: grid;
  gap: 12px;
}

.download-button {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.download-button--secondary {
  background: #0f9d86;
}

.download-topbar-spacer {
  width: 40px;
  height: 40px;
}

.title {
  margin: 0 0 10px;
  font-weight: 800;
}

@media (min-width: 520px) {
  .auth-shell {
    padding-top: 16px;
  }
}

/* —— Login page (screenshot layout) —— */
.auth-page--login {
  background: linear-gradient(
    180deg,
    #c5ebe6 0%,
    #dff5f2 28%,
    #f4fbfa 55%,
    #ffffff 100%
  );
}

.auth-page--login .auth-shell {
  padding: 8px 20px 32px;
}

.auth-page--login .auth-shell::before,
.auth-page--login .auth-shell::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 0;
}

.auth-page--login .auth-shell::before {
  top: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(130, 195, 190, 0.45) 0%, transparent 70%),
    linear-gradient(165deg, transparent 40%, rgba(100, 170, 165, 0.2) 40%, rgba(100, 170, 165, 0.2) 55%, transparent 55%),
    linear-gradient(195deg, transparent 35%, rgba(90, 160, 155, 0.18) 35%, rgba(90, 160, 155, 0.18) 50%, transparent 50%);
  opacity: 0.85;
}

.auth-page--login .auth-shell::after {
  bottom: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% 0%, rgba(130, 195, 190, 0.35) 0%, transparent 65%),
    linear-gradient(15deg, transparent 45%, rgba(100, 170, 165, 0.15) 45%, rgba(100, 170, 165, 0.15) 58%, transparent 58%);
  opacity: 0.7;
}

.auth-page--login .auth-phone::before {
  display: none;
}

.login-topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}

.login-topbar-title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.back-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  text-decoration: none;
}

.back-btn svg {
  width: 22px;
  height: 22px;
}

.auth-page--login .icon-btn--plain {
  justify-self: end;
  width: 40px;
  height: 40px;
  border: 0;
}

/* Reduce language button image size on login to prevent oversized icon */
.auth-page--login .icon-btn--plain img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.auth-page--login .icon-btn:first-child {
  border: 0;
  width: 40px;
  height: 40px;
}

.auth-page--login .hero {
  margin-bottom: 22px;
}

.auth-page--login .login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.auth-page--login .field--solid {
  background: #ffffff;
  border: 1px solid rgba(210, 220, 228, 0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-page--login .field .field-ico--accent {
  opacity: 1;
  color: var(--accent);
}

.auth-page--login .field .field-ico--img.field-ico--accent {
  opacity: 1;
}

.forgot {
  margin: -4px 0 20px;
  text-align: right;
  font-size: 14px;
  font-weight: 500;
}

.forgot a {
  color: var(--text);
  text-decoration: none;
}

.forgot a:hover {
  text-decoration: underline;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-stack .btn {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 52px;
  border-radius: 8px;
}
