/* ============================================================
   CONCILHE – portal.css  (Login Page)
   ============================================================ */
@import url('./tokens.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
img { max-width: 100%; height: auto; display: block; }
body {
  font-family: var(--font-body);
  color: var(--navy);
  background: #fff;
  overflow: hidden;
}
@media (max-width: 900px) { body { overflow: auto; } }

/* ── SPLIT LAYOUT ─────────────────────────────────────────── */
.portal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  height: 100dvh; /* iOS Safari: usa viewport dinâmico, sem barra de endereço */
}

/* ── LEFT PANEL ───────────────────────────────────────────── */
.portal-left {
  background: var(--dark);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.portal-left-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.portal-left-deco svg { width: 100%; height: 100%; position: absolute; inset: 0; }

.portal-left-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 40px 48px;
}
.portal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  transition: color .2s;
  text-decoration: none;
  margin-bottom: auto;
}
.portal-back:hover { color: var(--green); }
.portal-back svg { width: 16px; height: 16px; }

.portal-left-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}
.portal-brand-logo { height: 38px; width: auto; align-self: flex-start; margin-bottom: 28px; }
.portal-left-brand h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 16px;
}
.portal-left-brand h2 span { color: var(--green); }
.portal-left-brand p {
  font-size: 15px;
  color: rgba(255,255,255,.55);
  line-height: 1.75;
  max-width: 380px;
  margin-bottom: 36px;
}

.portal-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.portal-feat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,.80);
  font-size: 14px;
  font-weight: 500;
}
.portal-feat-ico {
  width: 40px; height: 40px;
  background: rgba(72,217,81,.10);
  border: 1px solid rgba(72,217,81,.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.portal-feat-ico svg { width: 19px; height: 19px; stroke: var(--green); fill: none; }

.portal-left-footer {
  font-size: 12px;
  color: rgba(255,255,255,.28);
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 20px;
}

/* ── RIGHT PANEL ──────────────────────────────────────────── */
.portal-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  overflow-y: auto;
  background: var(--white);
}
.portal-form-box {
  width: 100%;
  max-width: 400px;
}
.portal-form-top { margin-bottom: 36px; }
.portal-form-top h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}
.portal-form-top p { font-size: 14px; color: var(--blue-mid); }

/* Form fields */
.pf-group { margin-bottom: 18px; }
.pf-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 7px;
}
.pf-label a { color: var(--green-dark); font-weight: 600; font-size: 12px; }
.pf-label a:hover { text-decoration: underline; }

.pf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pf-ico {
  position: absolute;
  left: 13px;
  width: 18px; height: 18px;
  color: #b0b8cc;
  pointer-events: none;
  flex-shrink: 0;
}
.pf-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.pf-input-wrap input {
  width: 100%;
  padding: 13px 42px;
  border: 1.5px solid var(--gray-light);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--navy);
  outline: none;
  transition: border-color .22s, box-shadow .22s;
  background: #fafbfe;
}
.pf-input-wrap input::placeholder { color: #b8c3d8; }
.pf-input-wrap input:focus {
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(29,45,91,.07);
}
.pf-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  color: #b0b8cc;
  cursor: pointer;
  transition: color .2s;
}
.pf-eye:hover { color: var(--navy); }
.pf-eye svg { width: 18px; height: 18px; stroke: currentColor; fill: none; display: block; }

/* Remember me row */
.pf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.pf-row input[type=checkbox] { accent-color: var(--navy); width: 16px; height: 16px; cursor: pointer; }
.pf-row label { font-size: 13px; color: var(--blue-mid); cursor: pointer; user-select: none; }

/* Login button */
.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .22s, transform .22s, box-shadow .22s;
  position: relative;
  overflow: hidden;
}
.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.08) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .5s;
}
.btn-login:hover::before { transform: translateX(100%); }
.btn-login:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(60,170,60,.3);
}
.btn-login svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.btn-login.is-loading svg { display: none; }
.btn-login .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn-login.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.pf-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  font-size: 12px;
  color: var(--blue-mid);
}
.pf-divider::before,
.pf-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-light);
}

.pf-no-access {
  text-align: center;
  font-size: 13px;
  color: var(--blue-mid);
  margin-top: 8px;
}
.pf-no-access a { color: var(--green-dark); font-weight: 600; }
.pf-no-access a:hover { text-decoration: underline; }

/* Error message */
.pf-error {
  background: #fff0f0;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #b91c1c;
  margin-bottom: 16px;
  display: none;
}
.pf-error.show { display: block; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .portal-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .portal-left { min-height: 260px; padding: 32px 28px; }
  .portal-left-inner { padding: 28px; }
  .portal-left-brand { padding: 20px 0; }
  .portal-features { display: none; }
  .portal-right { padding: 36px 24px; align-items: flex-start; }
}

@media (max-width: 390px) {
  .portal-left-inner { padding: 20px 16px; }
  .portal-right { padding: 24px 16px; }
  .pf-card { padding: 28px 20px; }
}

/* iOS Safari: previne zoom automático em inputs */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px; }
}
