*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* safe area para Dynamic Island e home indicator */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.auth-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #dce9f8, #b8d4f4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-mark img { width: 40px; height: 40px; }

.auth-mark-img {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  flex-shrink: 0;
}

.auth-logo h1 { font-size: 1rem; font-weight: 700; color: #111; }
.auth-logo p  { font-size: .75rem; color: #666; }

h2 { font-size: 1.125rem; color: #111; }

form {
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .875rem;
  color: #444;
  font-weight: 500;
}

input {
  padding: .625rem .75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem; /* ≥16px previne zoom automático no iOS */
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none; /* remove estilo nativo do iOS */
  appearance: none;
}

input:focus { border-color: #0b55b7; }

.btn-primary {
  padding: .75rem;
  background: #0b55b7;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .25rem;
  transition: background .15s;
}

.btn-primary:hover { background: #0944a0; }

.auth-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: .75rem;
  border-radius: 8px;
  font-size: .875rem;
}

.auth-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .875rem;
  margin-bottom: 1rem;
}

.auth-link {
  text-align: center;
  font-size: .875rem;
  color: #666;
}

.auth-link a { color: #0b55b7; text-decoration: none; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }

.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  color: #374151;
  cursor: pointer;
  margin-bottom: 4px;
}
.checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  padding: 0;
  border-radius: 4px;
  accent-color: #0b55b7;
  -webkit-appearance: auto;
  appearance: auto;
  flex-shrink: 0;
  cursor: pointer;
}
.checkbox-label a { color: #0b55b7; text-decoration: none; font-weight: 500; }
.checkbox-label a:hover { text-decoration: underline; }

.trial-info {
  display: flex;
  align-items: center;
  gap: .875rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: .875rem 1rem;
}

.trial-info-badge {
  flex-shrink: 0;
  background: #16a34a;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.trial-info-text {
  font-size: .8125rem;
  color: #374151;
  line-height: 1.5;
}

.trial-info-text strong { color: #111827; }

.verify-icon { font-size: 2.5rem; text-align: center; }
.verify-text { text-align: center; font-size: .9375rem; color: #374151; line-height: 1.6; }
.verify-sub  { text-align: center; font-size: .8125rem; color: #6b7280; line-height: 1.6; }

@media (max-width: 480px) {
  body { align-items: flex-start; padding-top: max(1rem, calc(1rem + env(safe-area-inset-top))); }
  .auth-container { padding: .75rem; }
  .auth-card { padding: 1.5rem 1.25rem; border-radius: 8px; }
  .btn-primary { min-height: 48px; }
}

/* ============================================================
   REGISTER PAGE — layout split
   ============================================================ */
body.register-page {
  background: #f3f4f6;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.register-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100dvh;
  width: 100%;
}

/* Coluna esquerda */
.register-left {
  background: linear-gradient(145deg, #0b3d8f 0%, #0b55b7 60%, #1a6fd4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  padding-top: max(3rem, calc(3rem + env(safe-area-inset-top)));
  padding-bottom: max(3rem, calc(3rem + env(safe-area-inset-bottom)));
}

.register-left-inner {
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.reg-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.reg-brand .auth-mark {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
}

.reg-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.reg-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: .875rem;
}
.reg-hero p {
  font-size: .9375rem;
  color: rgba(255,255,255,.8);
  line-height: 1.65;
}

.reg-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.reg-benefits li {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
}

.reg-benefit-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.reg-benefits li div {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.reg-benefits strong {
  color: #fff;
  font-size: .9375rem;
  font-weight: 600;
}

.reg-benefits span {
  color: rgba(255,255,255,.65);
  font-size: .8125rem;
}

.reg-trial-box {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: .875rem 1.125rem;
}

.reg-trial-badge {
  flex-shrink: 0;
  background: #22c55e;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.reg-trial-text {
  font-size: .8125rem;
  color: rgba(255,255,255,.85);
  line-height: 1.5;
}
.reg-trial-text strong { color: #fff; }

/* Coluna direita */
.register-right {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 3rem 2rem;
  padding-top: max(3rem, calc(3rem + env(safe-area-inset-top)));
  padding-bottom: max(3rem, calc(3rem + env(safe-area-inset-bottom)));
  overflow-y: auto;
}

.register-right-inner {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.reg-form-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: .25rem;
}
.reg-form-header p {
  font-size: .875rem;
  color: #6b7280;
}

/* Mobile: empilha */
@media (max-width: 768px) {
  .register-layout { grid-template-columns: 1fr; }

  .register-left {
    padding: 2rem 1.5rem;
    padding-top: max(2rem, calc(2rem + env(safe-area-inset-top)));
  }
  .register-left-inner { gap: 1.5rem; }
  .reg-hero h1 { font-size: 1.375rem; }
  .reg-benefits { display: none; }

  .register-right {
    padding: 2rem 1.5rem;
    padding-bottom: max(2rem, calc(2rem + env(safe-area-inset-bottom)));
  }
}

/* ============================================================
   LOGIN PAGE — redesign
   ============================================================ */
body.login-page {
  background: #f0f4fb;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding-top: max(1.5rem, env(safe-area-inset-top));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.login-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.2);
}

/* ── Top hero section ── */
.login-hero {
  background: linear-gradient(145deg, #dce9f8 0%, #c5dcf5 100%);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}

.login-icon {
  width: 80px;
  height: 80px;
  margin-bottom: .4rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.15));
}

.login-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0D2C6E;
  letter-spacing: -.01em;
}

.login-logo-svg {
  height: 46px;
  width: auto;
  margin-bottom: .2rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.12));
}

.reg-logo-svg {
  height: 38px;
  width: auto;
  flex-shrink: 0;
}

.login-sub {
  font-size: .85rem;
  color: #5a7aaa;
  font-weight: 500;
}

/* ── Form section ── */
.login-form-area {
  padding: 2rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0D2C6E;
  margin-bottom: -.2rem;
}

.login-hint {
  font-size: .82rem;
  color: #94a3b8;
  margin-top: -.5rem;
}

.login-form-area form {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.login-form-area label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
}

.login-form-area input {
  padding: .75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #f8fafc;
  -webkit-appearance: none;
  appearance: none;
  color: #0f172a;
}

.login-form-area input:focus {
  border-color: #29ABE2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(41,171,226,.12);
}

.btn-login {
  margin-top: .2rem;
  padding: .875rem;
  background: linear-gradient(135deg, #29ABE2, #00C9C8);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .02em;
  box-shadow: 0 6px 20px rgba(41,171,226,.4);
  transition: transform .2s, box-shadow .2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(41,171,226,.5);
}

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

.login-form-area .auth-link {
  text-align: center;
  font-size: .85rem;
  color: #94a3b8;
}

.login-form-area .auth-link a {
  color: #1565C0;
  font-weight: 600;
  text-decoration: none;
}

.login-form-area .auth-link a:hover { text-decoration: underline; }

.login-form-area .auth-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: .75rem 1rem;
  border-radius: 10px;
  font-size: .875rem;
}

.login-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: .75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e2eaf6;
  z-index: 10;
}

.login-mtjl-logo {
  height: 32px;
  width: auto;
  display: block;
}

body.login-page { padding-top: calc(56px + 2rem); }

@media (max-width: 480px) {
  body.login-page { padding: calc(56px + 1rem) 1rem 1rem; align-items: flex-start; padding-top: max(calc(56px + 1rem), env(safe-area-inset-top)); }
  .login-card { border-radius: 16px; }
  .login-hero { padding: 2rem 1.5rem 1.5rem; }
  .login-form-area { padding: 1.5rem 1.5rem 2rem; }
  .btn-login { min-height: 52px; }
}
