/* ============================================================
 * Madala Auth — Estilos da página /entrar
 * Prefixo body.ma-body em todas as regras críticas para
 * ganhar especificidade contra o tema activo.
 * ============================================================ */

/* ── Tokens ───────────────────────────────────────────────── */
body.ma-body {
  --bg:        #F4F5F7;
  --white:     #FFFFFF;
  --dark:      #151A28;
  --accent:    #D56E33;
  --accent-dk: #C05B25;
  --text:      #222222;
  --text-2:    #5A6070;
  --text-3:    #9498A5;
  --border:    #D8DBE4;
  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow:    0 4px 32px rgba(0,0,0,.12);
  --tr:        0.18s ease;
  font-family: 'Ubuntu', sans-serif;
  background:  var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Page wrapper ───────────────────────────────────────────── */
/* background-image (padrão SVG) injectado via wp_add_inline_style */
body.ma-body .ma-page {
  min-height: 72vh;
  padding: 48px 16px 80px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #F4F5F7;
}

/* ── Card ───────────────────────────────────────────────────── */
body.ma-body .ma-card {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Brand ──────────────────────────────────────────────────── */
body.ma-body .ma-brand {
  padding: 32px 28px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
body.ma-body .ma-logo-img {
  max-height: 56px;
  width: auto;
  display: block;
  margin: 0 auto 8px;
}
body.ma-body .ma-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  display: block;
  margin-bottom: 4px;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-brand-tagline {
  font-size: .8rem;
  color: var(--text-3);
  margin: 0;
  font-family: 'Ubuntu', sans-serif;
}

/* ── Global error alert ─────────────────────────────────────── */
body.ma-body .ma-alert {
  margin: 12px 24px 0;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: .83rem;
  font-weight: 500;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-alert--error {
  background: #FFF0EC;
  color: #B83820;
  border: 1px solid #FBBDAD;
}

/* ── Tabs ───────────────────────────────────────────────────── */
body.ma-body .ma-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

body.ma-body .ma-tab {
  /* full reset so the theme doesn't touch these */
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  text-decoration: none;
  outline: none;

  flex: 1;
  padding: 13px 6px;
  background: transparent !important;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-family: 'Ubuntu', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--tr), border-color var(--tr);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 1.2;
}
body.ma-body .ma-tab:hover {
  color: var(--dark);
  background: transparent !important;
}
body.ma-body .ma-tab--active {
  border-bottom-color: var(--accent);
  color: var(--accent) !important;
  font-weight: 700;
  background: transparent !important;
}
body.ma-body .ma-tab--vendor {
  color: var(--accent);
  font-weight: 600;
}
body.ma-body .ma-tab--vendor.ma-tab--active {
  background: rgba(213,110,51,.06) !important;
}

/* ── Panel ──────────────────────────────────────────────────── */
body.ma-body .ma-panel {
  padding: 24px 24px 28px;
}
body.ma-body .ma-panel--hidden {
  display: none !important;
}

/* ── Vendor hero ─────────────────────────────────────────────── */
body.ma-body .ma-vendor-hero {
  background: linear-gradient(135deg, #FDF1EB 0%, #FFF7F3 100%);
  border: 1px solid rgba(213,110,51,.18);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 20px;
  text-align: center;
}
body.ma-body .ma-vendor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-vendor-sub {
  margin: 0;
  font-size: .82rem;
  color: var(--text-2);
  font-family: 'Ubuntu', sans-serif;
}

/* ── Section title ───────────────────────────────────────────── */
body.ma-body .ma-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 20px 0 12px;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-section-title:first-child { margin-top: 0; }

/* ── Fields ─────────────────────────────────────────────────── */
body.ma-body .ma-field {
  margin-bottom: 14px;
}
body.ma-body .ma-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
  letter-spacing: .02em;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-req {
  color: var(--accent);
  text-decoration: none;
  margin-left: 2px;
}
body.ma-body .ma-optional {
  font-size: .7rem;
  font-weight: 400;
  color: var(--text-3);
}

/* ── Inputs ─────────────────────────────────────────────────── */
body.ma-body .ma-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xs) !important;
  font-family: 'Ubuntu', sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--white) !important;
  box-shadow: none !important;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  transition: border-color var(--tr), box-shadow var(--tr);
  margin: 0;
}
body.ma-body .ma-input::placeholder { color: var(--text-3); }
body.ma-body .ma-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(213,110,51,.12) !important;
  outline: none;
}
body.ma-body select.ma-input,
body.ma-body .ma-select {
  cursor: pointer;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239498A5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px !important;
}

/* ── Password wrapper + eye ─────────────────────────────────── */
body.ma-body .ma-input-wrap {
  position: relative;
}
body.ma-body .ma-input-wrap .ma-input {
  padding-right: 42px;
}
body.ma-body .ma-eye {
  /* hard reset — overrides any theme button style */
  all: unset;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px;
  margin: 0;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0;
}
body.ma-body .ma-eye:hover { color: var(--text-2); }
body.ma-body .ma-eye svg { display: block; }

/* ── Phone wrapper ──────────────────────────────────────────── */
body.ma-body .ma-phone-wrap {
  display: flex;
  gap: 8px;
}
body.ma-body .ma-phone-code {
  width: 108px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xs) !important;
  font-family: 'Ubuntu', sans-serif;
  font-size: .82rem;
  color: var(--text);
  background: var(--bg) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239498A5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 6px center !important;
  background-size: 12px !important;
  box-shadow: none !important;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
body.ma-body .ma-phone-code:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(213,110,51,.12) !important;
}
body.ma-body .ma-phone-num { flex: 1; }

/* ── Two-column row ─────────────────────────────────────────── */
body.ma-body .ma-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Inline error ────────────────────────────────────────────── */
body.ma-body .ma-error {
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: #FFF0EC;
  color: #B83820;
  border: 1px solid #FBBDAD;
  font-size: .82rem;
  font-weight: 500;
  font-family: 'Ubuntu', sans-serif;
  margin-bottom: 14px;
}

/* ── Buttons — base reset ────────────────────────────────────── */
body.ma-body .ma-btn {
  /* reset theme */
  all: unset;
  box-sizing: border-box;

  display: flex !important;
  width: 100% !important;
  height: 48px;
  border-radius: var(--radius-sm) !important;
  font-family: 'Ubuntu', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--tr), opacity var(--tr), transform var(--tr);
  margin-bottom: 12px;
  text-align: center;
  line-height: 1;
}
body.ma-body .ma-btn:active:not(:disabled) { transform: scale(.98); }
body.ma-body .ma-btn:disabled { opacity: .6; cursor: not-allowed; }

body.ma-body .ma-btn--primary {
  background: var(--dark) !important;
  color: #fff !important;
}
body.ma-body .ma-btn--primary:hover:not(:disabled) {
  background: #0d1120 !important;
}

body.ma-body .ma-btn--vendor {
  background: var(--accent) !important;
  color: #fff !important;
  margin-top: 4px;
}
body.ma-body .ma-btn--vendor:hover:not(:disabled) {
  background: var(--accent-dk) !important;
}

body.ma-body .ma-btn--outline {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-2) !important;
  font-size: .83rem;
  height: 42px;
}
body.ma-body .ma-btn--outline:hover:not(:disabled) {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ── Spinner ─────────────────────────────────────────────────── */
body.ma-body .ma-spinner {
  width: 22px;
  height: 22px;
  animation: ma-spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes ma-spin { to { transform: rotate(360deg); } }

/* ── Forgot link ─────────────────────────────────────────────── */
body.ma-body .ma-forgot {
  all: unset;
  box-sizing: border-box;
  display: block !important;
  width: 100% !important;
  text-align: center;
  font-size: .8rem;
  color: var(--text-3) !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  text-decoration: none;
  margin-bottom: 4px;
  padding: 6px 4px;
  font-family: 'Ubuntu', sans-serif;
  cursor: pointer;
  line-height: 1.2;
}
body.ma-body .ma-forgot:hover { color: var(--accent) !important; }

/* ── Social login ─────────────────────────────────────────────── */
body.ma-body .ma-social-wrap { margin-top: 16px; }

body.ma-body .ma-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--text-3);
  font-size: .75rem;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-divider::before,
body.ma-body .ma-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

body.ma-body .ma-social-row {
  display: flex;
  gap: 10px;
}

body.ma-body .ma-social-btn {
  all: unset;
  box-sizing: border-box;
  flex: 1;
  height: 44px;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xs) !important;
  background: var(--white) !important;
  font-family: 'Ubuntu', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color var(--tr), box-shadow var(--tr);
}
body.ma-body .ma-social-btn:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

/* ── Back button (forgot flow) ───────────────────────────────── */
body.ma-body .ma-back-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Ubuntu', sans-serif;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 16px;
  transition: color var(--tr);
}
body.ma-body .ma-back-btn:hover { color: var(--accent); }

/* ── Forgot form heading ─────────────────────────────────────── */
body.ma-body .ma-forgot-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-forgot-desc {
  font-size: .83rem;
  color: var(--text-2);
  margin: 0 0 18px;
  font-family: 'Ubuntu', sans-serif;
  line-height: 1.5;
}

/* ── Success state ───────────────────────────────────────────── */
body.ma-body .ma-success-icon {
  width: 64px;
  height: 64px;
  background: rgba(213,110,51,.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}
body.ma-body .ma-success-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  margin-bottom: 8px;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-success-desc {
  font-size: .83rem;
  color: var(--text-2);
  text-align: center;
  margin: 0 0 20px;
  font-family: 'Ubuntu', sans-serif;
  line-height: 1.55;
}

/* ── Reset password panel ────────────────────────────────────── */
body.ma-body .ma-reset-header {
  text-align: center;
  margin-bottom: 24px;
}
body.ma-body .ma-reset-icon {
  width: 56px;
  height: 56px;
  background: rgba(213,110,51,.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--accent);
}
body.ma-body .ma-reset-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
  font-family: 'Ubuntu', sans-serif;
}
body.ma-body .ma-reset-desc {
  font-size: .83rem;
  color: var(--text-2);
  margin: 0;
  font-family: 'Ubuntu', sans-serif;
  line-height: 1.5;
}

/* ── reCAPTCHA notice ────────────────────────────────────────── */
body.ma-body .ma-recaptcha-note {
  margin: 14px 0 0;
  font-size: .7rem;
  color: var(--text-3);
  text-align: center;
  font-family: 'Ubuntu', sans-serif;
  line-height: 1.4;
}
body.ma-body .ma-recaptcha-note a {
  color: var(--text-3);
  text-decoration: underline;
}
body.ma-body .ma-recaptcha-note a:hover { color: var(--accent); }

/* ── Geolocation + Map ───────────────────────────────────────── */
body.ma-body .ma-geo-hint {
  margin: 6px 0 8px;
  font-size: .75rem;
  color: var(--text-3);
  font-family: 'Ubuntu', sans-serif;
}

body.ma-body .ma-map {
  height: 220px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  margin: 10px 0 0;
  position: relative;
  z-index: 0;
}

body.ma-body .ma-coords-display {
  background: var(--bg) !important;
  font-size: .78rem !important;
  color: var(--text-3) !important;
  cursor: default;
  height: 36px;
  margin-top: 0 !important;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 400px) {
  body.ma-body .ma-panel  { padding: 18px 16px 24px; }
  body.ma-body .ma-brand  { padding: 24px 16px 16px; }
  body.ma-body .ma-row-2  { grid-template-columns: 1fr; }
  body.ma-body .ma-tab    { font-size: .72rem; padding: 12px 4px; }
}
