/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  --blue: #1952d8;
  --blue-hover: #1340b0;
  --blue-disabled: #9db4e8;
  --text: #1a1a1a;
  --text-mid: #555;
  --text-muted: #999;
  --error: #d33a4b;
  --border: #e0e0e0;
  --input-border: #c8c8c8;
  --bg-panel: #f7f7f7;
  --bg-card: #ffffff;
  --radius: 6px;
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0s;
    --transition-base: 0s;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--text);
}

/* Safe keyboard-focus fallback: browsers without :focus-visible support
   still show an outline on focus; modern browsers hide it for mouse clicks. */
.tab:focus,
.info-btn:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.tab:focus:not(:focus-visible),
.info-btn:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   Page layout: photo + form row, footer bar
   ========================================================================== */

.main-row {
  /* grow to fill the viewport, but never shrink below what the
     photo + form actually need — lets the page scroll instead of
     the form overlapping the footer on short viewports */
  flex: 1 0 auto;
  display: flex;
}

.side-photo {
  flex: 1;
  background: url("/public/images/background.png") center / cover no-repeat;
}

.side-form {
  width: 46%;
  min-width: 400px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
}

.form-scroll {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.login-box {
  width: 100%;
  max-width: 360px;
}

.footer {
  padding: 14px 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 12px;
  color: var(--text-mid);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Logo & title
   ========================================================================== */

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo img {
  height: 30px;
  width: auto;
}

.title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  margin-bottom: 30px;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  padding: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition-fast);
  user-select: none;
}

.tab.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--blue);
}

.tab svg {
  flex-shrink: 0;
}

/* ── Info icon + tooltip (Acesso personalizado) ── */

.info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  margin: 0;
  padding: 2px;
  color: inherit;
  cursor: pointer;
  line-height: 0;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: -10px;
  width: 220px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 30;
}

.tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ==========================================================================
   Form fields
   ========================================================================== */

.field {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.field input {
  width: 100%;
  padding: 8px 36px 8px 26px;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--input-border);
  outline: none;
  transition: border-color var(--transition-base);
}

.field input::placeholder {
  color: var(--text-muted);
}

.field input:focus {
  border-bottom-color: var(--blue);
}

.field input.invalid {
  border-bottom-color: var(--error);
}

.field-msg {
  display: block;
  min-height: 14px;
  margin: 4px 0 16px;
  font-size: 12px;
  line-height: 14px;
  color: var(--error);
}

.toggle-eye {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  line-height: 0;
}

.toggle-eye:hover {
  color: var(--text-mid);
}

/* ==========================================================================
   Submit button
   ========================================================================== */

.btn-submit {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition-base);
  margin-bottom: 14px;
}

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

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

.btn-submit:disabled {
  background: var(--blue-disabled);
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Privacy notice
   ========================================================================== */

.privacy {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

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

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

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet portrait */
@media (max-width: 900px) {
  .side-form {
    width: 52%;
    min-width: 340px;
  }

  .form-scroll {
    padding: 40px 32px;
  }
}

/* Mobile: stack photo above form */
@media (max-width: 640px) {
  .main-row {
    flex-direction: column;
  }

  .side-photo {
    height: 220px;
    flex: none;
  }

  .side-form {
    width: 100%;
    min-width: unset;
  }

  .form-scroll {
    padding: 36px 24px;
    align-items: flex-start;
  }

  .login-box {
    max-width: 100%;
  }

  .footer {
    padding: 14px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-links {
    gap: 14px;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .title {
    font-size: 19px;
  }

  .tabs {
    gap: 20px;
  }
}
