@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg-0: #f3f6fb;
  --bg-1: #ffffff;
  --ink-0: #0f172a;
  --ink-1: #334155;
  --muted: #64748b;
  --line: #dbe3ef;
  --brand: #0b5fff;
  --brand-strong: #0047cc;
  --ok: #0f9d58;
  --warn: #c47e00;
  --err: #b42318;
  --card-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body.corp {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink-0);
  background:
    radial-gradient(1200px 600px at -10% -20%, #dce8ff 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% -20%, #e8f7ff 0%, transparent 55%),
    var(--bg-0);
}

.auth-topbar {
  max-width: 1100px;
  margin: 14px auto 0;
  padding: 0 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-card {
  width: min(980px, 100%);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-brand {
  padding: 36px;
  color: #fff;
  background: linear-gradient(145deg, rgba(6, 40, 110, 0.92), rgba(7, 88, 190, 0.9));
  position: relative;
  overflow: hidden;
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0.05));
  pointer-events: none;
}

.auth-brand-logo {
  width: 180px;
  max-width: 70%;
  height: auto;
  object-fit: contain;
  margin-bottom: 14px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.24));
  opacity: 1;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 8px 10px;
}

.auth-form-logo-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
  margin-bottom: 16px;
}

.auth-form-logo {
  width: 168px;
  max-width: 46%;
  height: auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.auth-brand h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  letter-spacing: 0.2px;
}

.auth-brand p {
  margin: 0 0 24px;
  opacity: 0.92;
}

.auth-pill-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.auth-pill-list li {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.92rem;
}

.auth-form {
  padding: 36px;
}

.auth-form h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.auth-form .subtitle {
  margin: 0 0 20px;
  color: var(--muted);
}

.corp-label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 700;
  font-size: 0.92rem;
}

.corp-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.corp-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.12);
}

.corp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.corp-btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
}

.corp-btn-primary:hover {
  background: var(--brand-strong);
  color: #fff;
}

.corp-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.corp-link:hover {
  text-decoration: underline;
}

.auth-footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.flash-success {
  color: #0f5132;
  background: #def7ec;
  border-color: #9ddfc0;
}

.flash-danger,
.flash-error {
  color: #7a271a;
  background: #fee4e2;
  border-color: #f5b5b2;
}

.flash-warning {
  color: #7a5310;
  background: #fff4d4;
  border-color: #f0d390;
}

.billing-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.billing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.billing-kpi {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.billing-kpi .kpi-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.billing-kpi .kpi-value {
  font-size: 1.1rem;
  font-weight: 800;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.locale-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.locale-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.6) !important;
  background: #fff !important;
  color: #334155 !important;
  font-weight: 700;
  padding: 6px 10px !important;
  line-height: 1;
}

.locale-btn:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}

.locale-btn.active {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
  background: #ecfdf3 !important;
  color: #166534 !important;
}

.locale-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
}

.locale-flag-img {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  display: inline-block;
}

@media (max-width: 640px) {
  .auth-topbar {
    justify-content: center;
    margin-top: 10px;
  }

  .locale-switch {
    width: 100%;
    justify-content: center;
  }

  .locale-btn {
    min-height: 34px;
  }
}

.locale-flag-es {
  background-image: url("/static/flags/es.svg");
}

.locale-flag-en {
  background-image: url("/static/flags/gb.svg");
}

.corp-btn-sm {
  padding: 8px 12px;
  font-size: 0.86rem;
}

.corp-btn-outline {
  border-color: var(--line);
  color: var(--ink-1);
  background: #fff;
}

.corp-btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-1);
  background: #fff;
}

@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    order: 2;
    padding: 24px;
  }

  .auth-form {
    order: 1;
    padding: 24px;
  }

  .auth-form-logo {
    width: 118px;
    max-width: 35%;
  }

  .auth-form-logo-wrap {
    margin-top: 0;
    margin-bottom: 12px;
  }

  .billing-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}
