/* Login page custom styles */

html, body { height: 100%; }
body.login-body { margin: 0; min-height: 100vh; background: #f5f7fb; }

/* Split layout */
.login-split-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left side (form) */
.login-left {
  flex: 0 0 420px; /* fixed column width */
  max-width: 420px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-shadow: inset -1px 0 0 rgba(0,0,0,0.04);
}

/* Card container (override Bulma .box for a cleaner look) */
.login-form-container.box {
  border: none;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: 360px;
}

/* Header and branding */
.login-header { margin-bottom: 16px; }
.login-brand { display: flex; align-items: center; gap: 6px; }
.login-logo { width: 60px; height: 60px; object-fit: contain; }
.login-title { font-size: 24px; font-weight: 700; color: #222; margin: 0; }
.login-subtitle { font-size: 12px; color: #7a7a7a; margin: 4px 0 0; }

/* Alerts */
.login-alert { margin-bottom: 12px; }

/* Inputs with icons */
.login-input-group { margin-bottom: 12px; }
.login-input-wrapper { position: relative; display: flex; align-items: center; }
.login-input-icon { position: absolute; left: 12px; color: #a0a0a0; z-index: 2; pointer-events: none; top: 50%; transform: translateY(-50%); }
.login-input.input { padding-left: 40px; height: 40px; border-radius: 6px; position: relative; z-index: 1; }

/* Submit button */
.login-btn.button { margin-top: 8px; height: 40px; border-radius: 6px; }

/* Links and footer */
.login-links { margin-top: 12px; font-size: 12px; color: #7a7a7a; }
.login-link { color: #3273dc; }
.login-footer { margin-top: 24px; font-size: 11px; color: #999; }

/* Right side (background image) */
.login-right {
  flex: 1;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Overlay and content */
.login-bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-bg-content {
  position: relative;
  color: #fff;
  max-width: 620px;
  width: 100%;
  text-align: left;
}
.login-bg-icon { font-size: 48px; line-height: 1; color: #fff; display: inline-flex; align-items: center; justify-content: center; background-color: rgba(255, 255, 255, 0.15); border-radius: 50%; padding: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); margin: 0 12px 0 0; vertical-align: baseline; }
.login-bg-title { display: inline-block; vertical-align: baseline; font-size: 36px; font-weight: 800; color: #fff; margin: 0; }
.login-bg-subtitle { font-size: 16px; color: rgba(255,255,255,0.9); margin: 8px 0 14px; font-weight: 400; }
.login-bg-features { margin-top: 8px; }
.login-bg-feature { display: flex; align-items: center; gap: 10px; color: #fff; margin: 8px 0; }
.login-bg-feature i { opacity: 0.95; }

/* Responsive behavior */
@media (max-width: 1024px) {
  .login-left { flex: 0 0 380px; max-width: 380px; }
}

@media (max-width: 768px) {
  .login-split-container { flex-direction: column; }
  .login-left { flex: none; max-width: 100%; box-shadow: none; }
  .login-form-container.box { max-width: 420px; margin: 32px auto; }
  .login-right { min-height: 320px; }
  .login-bg-overlay { align-items: flex-end; justify-content: flex-start; padding: 24px; z-index: 2; }
}

/* Subtitle row with locale switch aligned right */
.login-subheader { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.login-locale-switch { display: inline-block; position: relative; width: 36px; height: 24px; border: 1px solid #ccc; border-radius: 3px; overflow: visible; cursor: pointer; }
.login-locale-label { font-size: 0.9rem; }
/* Bandeira por CSS: PT (gradiente verde/vermelho + brasão) e GB (Union Jack simplificado) */
.login-locale-switch::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, #006600 0%, #006600 40%, #CC0000 40%, #CC0000 100%); pointer-events: none; }
.login-locale-switch.lang-pt_PT::after { content: ''; position: absolute; top: 50%; left: 40%; transform: translate(-50%, -50%); width: 16px; height: 16px; background-image: url('../img/crest_pt.svg'); background-size: contain; background-repeat: no-repeat; pointer-events: none; }
.login-locale-switch.lang-en::before { content: ''; background-image: url('../img/flag_uk.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; pointer-events: none; }
/* Select invisível sobre a área da bandeira para abrir o dropdown nativo */
.login-locale-switch .select { display: none; position: absolute; inset: 0; width: 100%; height: 100%; background: transparent !important; border: none !important; box-shadow: none !important; }
.login-locale-switch .select::after { display: none !important; }
.login-locale-switch .select { border-radius: 20%; overflow: hidden; }
.login-locale-switch .select select { opacity: 0; appearance: none; -webkit-appearance: none; width: 100%; height: 100%; cursor: pointer; border: 0; background: transparent; padding: 0; font-size: 16px; text-align: right; direction: rtl; border-radius: 20%; }
.login-locale-switch .select select option { font-size: 16px; text-align: right; padding-inline: 12px; padding-left: 12px; padding-right: 12px; text-indent: 12px; }

@media (max-width: 768px) {
  .login-subheader { flex-wrap: wrap; gap: 8px; }
}

/* Custom menu para idioma: alinhado à direita, cantos arredondados e padding */
.login-locale-switch .locale-menu.open { display: block; }
.login-locale-switch .locale-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 120px; max-width: 160px; width: auto; background: #fff; border: 1px solid #d0d0d0; border-radius: 0; box-shadow: 0 8px 16px rgba(0,0,0,0.12); display: none; z-index: 1000; overflow: visible; padding: 3px 4px; }
.login-locale-switch .locale-item { padding: 4px 7px 4px 3px; font-size: 16px; line-height: 1.4; text-align: right; cursor: pointer; white-space: nowrap; border-radius: 10%; margin: 2px 0; }
.login-locale-switch .locale-item:hover { background: #f2f6ff; }
.login-locale-switch .locale-item.is-active { background: #e9f0ff; font-weight: 600; }
.login-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../img/bkground_porto.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(1.1) saturate(1.05) contrast(1.05);
  z-index: 0;
}
.login-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(11, 78, 140, 0.55);
  background-image: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.3) 100%);
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 1;
}
.login-bg-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 24px;
  padding-left: 48px;
  padding-bottom: 24px;
  z-index: 2;
}
.login-bg-content {
  position: relative;
  color: #fff;
  max-width: 620px;
  width: 100%;
  text-align: left;
}
.login-bg-icon { font-size: 48px; line-height: 1; margin-bottom: 8px; color: #fff; }
.login-bg-title { font-size: 28px; font-weight: 700; margin: 6px 0 12px; color: #fff; }
.login-bg-subtitle { font-size: 14px; color: rgba(255,255,255,0.85); margin-bottom: 16px; }
.login-bg-features { margin-top: 8px; }
.login-bg-feature { display: flex; align-items: center; gap: 10px; color: #fff; margin: 8px 0; line-height: 1.5; }
.login-bg-feature i { opacity: 0.95; }

/* Responsive behavior */
@media (max-width: 1024px) {
  .login-left { flex-basis: 380px; max-width: 380px; }
}

@media (max-width: 768px) {
  .login-split-container { flex-direction: column; }
  .login-left { flex: none; max-width: 100%; box-shadow: none; }
  .login-form-container.box { max-width: 420px; margin: 32px auto; }
  .login-right { min-height: 320px; }
  .login-bg-overlay { align-items: flex-end; }
}

/* Subtitle row with locale switch aligned right */
.login-subheader { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.login-locale-switch { display: inline-block; position: relative; width: 36px; height: 24px; border: 1px solid #ccc; border-radius: 3px; overflow: visible; cursor: pointer; }
.login-locale-label { font-size: 0.9rem; }
/* Bandeira por CSS: PT (gradiente verde/vermelho + brasão) e GB (Union Jack simplificado) */
.login-locale-switch::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, #006600 0%, #006600 40%, #CC0000 40%, #CC0000 100%); pointer-events: none; }
.login-locale-switch.lang-pt_PT::after { content: ''; position: absolute; top: 50%; left: 40%; transform: translate(-50%, -50%); width: 16px; height: 16px; background-image: url('../img/crest_pt.svg'); background-size: contain; background-repeat: no-repeat; pointer-events: none; }
.login-locale-switch.lang-en::before { content: ''; background-image: url('../img/flag_uk.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; pointer-events: none; }
/* Select invisível sobre a área da bandeira para abrir o dropdown nativo */
.login-locale-switch .select { display: none; position: absolute; inset: 0; width: 100%; height: 100%; background: transparent !important; border: none !important; box-shadow: none !important; }
.login-locale-switch .select::after { display: none !important; }
.login-locale-switch .select { border-radius: 20%; overflow: hidden; }
.login-locale-switch .select select { opacity: 0; appearance: none; -webkit-appearance: none; width: 100%; height: 100%; cursor: pointer; border: 0; background: transparent; padding: 0; font-size: 16px; text-align: right; direction: rtl; border-radius: 20%; }
.login-locale-switch .select select option { font-size: 16px; text-align: right; padding-inline: 12px; padding-left: 12px; padding-right: 12px; text-indent: 12px; }

@media (max-width: 768px) {
  .login-subheader { flex-wrap: wrap; gap: 8px; }
}

/* Custom menu para idioma: alinhado à direita, cantos arredondados e padding */
.login-locale-switch .locale-menu.open { display: block; }
.login-locale-switch .locale-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 120px; max-width: 160px; width: auto; background: #fff; border: 1px solid #d0d0d0; border-radius: 0; box-shadow: 0 8px 16px rgba(0,0,0,0.12); display: none; z-index: 1000; overflow: visible; padding: 3px 4px; }
.login-locale-switch .locale-item { padding: 4px 7px 4px 3px; font-size: 16px; line-height: 1.4; text-align: right; cursor: pointer; white-space: nowrap; border-radius: 10%; margin: 2px 0; }
.login-locale-switch .locale-item:hover { background: #f2f6ff; }
.login-locale-switch .locale-item.is-active { background: #e9f0ff; font-weight: 600; }