/* Macmillan Hub - Estilo baseado no design oficial */

/* Importar fonte Montserrat do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* === FIX MOBILE: evita scroll lateral e estourar largura === */
html, body { width: 100%; overflow-x: hidden; }

:root {
  --coral-red: #ff260a;
  --coral-red-dark: #D43D33;
  --teal-green: #00A39B;
  --white: #FFFFFF;
  --text-dark: #333333;
  --text-gray: #666666;
  --input-border: rgba(0, 0, 0, 0.2);
  --background-red: #E84E44;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
}

/* Background Hero com overlay */
.macmillan-hero {
  position: relative;
  min-height: 100vh;
  background: var(--background-red);
  display: flex;
  flex-direction: column;          /* FIX MOBILE: fluxo em coluna */
  justify-content: center;
  align-items: center;
  padding: 24px 16px 80px;         /* espaço para o footer em mobile */
  overflow: hidden;
}

.macmillan-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url('../../images/macmillanhub_login.png');
  background-size: cover;
  background-position: center;
  opacity: 1;
  z-index: 0;
}

/* Container principal (mantém tudo acima do overlay) */
.macmillan-container {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1400px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;          /* centralizado por padrão */
  gap: 16px;
}

/* Bandeirinhas (usar SVGs) */
.lang-switch a {
  width: 28px; height: 20px;
  display: inline-block;
  transition: transform .2s ease, opacity .2s ease;
}
.lang-switch img { width: 100%; height: auto; border-radius: 2px; box-shadow: 0 0 3px rgba(0,0,0,.2); }
.lang-switch a:hover img { transform: scale(1.1); }
.lang-switch .active img { opacity: .4; pointer-events: none; }
/* FIX MOBILE/GERAL: fixa no canto para não empurrar layout */
.lang-switch { position: fixed; top: 12px; right: 12px; z-index: 10; }

/* Logo */
.macmillan-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}
.macmillan-logo img {
  max-width: 500px;   /* desktop */
  height: auto;
}

/* Card do formulário */
.login-card {
  position: relative;
  z-index: 4;
  background: var(--white);
  border-radius: 10px;
  padding: 3rem 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 450px;
  margin: 0 auto;                         /* FIX MOBILE: centraliza sempre */
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

.login-card h2 { font-size: 1.5rem; color: var(--text-dark); margin-bottom: 2rem; font-weight: 600; }

/* Form */
.form-group { margin-bottom: 1.5rem; }

.form-label {
  display: block; font-size: 15px; color: var(--text-dark);
  margin-bottom: .5rem; font-weight: 300; font-family: 'Montserrat', sans-serif;
}

.form-control {
  width: 100%; padding: .875rem 1rem; font-size: 1rem;
  border: 1px solid var(--input-border); border-radius: 2px; transition: all .3s ease;
  font-family: 'Montserrat', sans-serif;
}
.form-control:focus {
  outline: none; border-color: var(--coral-red);
  box-shadow: 0 0 0 3px rgba(255, 38, 10, 0.1);
}
select.form-control { cursor: pointer; }

/* Password toggle */
.password-wrapper { position: relative; }
.password-toggle {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--coral-red);
  font-size: 1.2rem; padding: .25rem;
}
.password-toggle:hover { opacity: .7; }

/* Lembrar-me */
.remember-me { display: flex; align-items: center; margin-bottom: 1rem; }
.remember-me input[type="checkbox"] {
  width: 21px; height: 21px; margin-right: .5rem; cursor: pointer;
  accent-color: var(--coral-red); border: 1px solid var(--coral-red);
}
.remember-me label { font-size: 15px; color: var(--text-dark); cursor: pointer; user-select: none; font-weight: 300; }

/* Esqueceu sua senha (logo abaixo do lembrar-me) */
.forgot-password-inline { text-align: right; margin: 8px 0 18px; }
.forgot-password-inline .forgot-password {
  color: #E94235; font-size: .9rem; text-decoration: none; transition: color .3s ease;
}
.forgot-password-inline .forgot-password:hover { color: #BB0A11; text-decoration: underline; }

/* Botão */
.btn-acessar {
  width: 100%; padding: 1rem; font-size: 20px; font-weight: 600;
  color: var(--white); background: var(--coral-red);
  border: none; border-radius: 5px; cursor: pointer; transition: all .3s ease;
}
.btn-acessar:hover { background: var(--coral-red-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 38, 10, 0.3); }
.btn-acessar:active { transform: translateY(0); }
.btn-acessar:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Links do rodapé de cadastro */
.register-link {
  display: block; text-align: center; margin-top: 1rem; color: var(--text-gray); font-size: .9rem;
}
.register-link a { color: var(--coral-red); text-decoration: none; font-weight: 600; }
.register-link a:hover { text-decoration: underline; }

/* Footer (mobile-first) */
.macmillan-hero{
  display:flex;
  flex-direction:column;
  min-height:100vh;            /* para o footer grudar no fim */
}

.macmillan-footer{
  position: static;            /* padrão: nada de absolute no mobile */
  width:100%;
  margin-top:auto;             /* empurra pro fim do .macmillan-hero */
  padding:12px 16px;
  text-align:center;
  line-height:1.4;
  white-space: normal;         /* deixa quebrar linha */
}

.macmillan-footer a{
  display:inline;
  margin:0 .25rem;
  text-decoration:underline;
  color: rgba(255,255,255,.9);
}
.macmillan-footer a:hover{ color:#fff; }

/* Só em telas grandes (desktop) volta a ser absolute */
@media (min-width: 1024px){
  .macmillan-footer{
    position:absolute;
    bottom:1.5rem; left:0; right:0;
    margin-top:0;
    padding:0;
  }
}

/* Alerts */
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: .9rem; }
.alert-error   { background: #ffe6e6; color: #cc0000; border: 1px solid #ffcccc; }
.alert-success { background: #e6ffe6; color: #006600; border: 1px solid #ccffcc; }
.alert-info    { background: #e6f3ff; color: #0066cc; border: 1px solid #cce6ff; }

/* ===================== RESPONSIVO ===================== */

/* até 1133px */
@media (max-width: 1133px) {
  .login-card { max-width: 400px; }
  .macmillan-footer { font-size: 12px; padding: 0 1rem; }
}

/* até 744px (tablet portrait) */
@media (max-width: 744px) {
  .macmillan-hero { padding: 24px 16px 72px; }
  .macmillan-container { padding: 1.5rem; }

  .macmillan-logo { margin-bottom: 24px; }
  .macmillan-logo img { max-width: 58vw; }

  .login-card {
    padding: 2rem 1.5rem;
    max-width: 360px;
    border-radius: 10px;
  }

  /* Footer volta para o fluxo para não “escapar” para a lateral */
  .macmillan-footer {
    position: static;          /* FIX MOBILE: não absoluto */
    width: 100%;
    margin-top: auto;
    padding: 12px 16px;
    font-size: 11px;
    line-height: 1.6;
    white-space: normal;       /* permite quebra de linha */
  }

  /* “Esqueceu sua senha?” centralizado no mobile */
  .forgot-password-inline { text-align: center; }
}

/* até 393px (smartphone pequeno) */
@media (max-width: 393px) {
  .macmillan-hero { padding: 16px 12px 64px; }
  .macmillan-container { padding: 0; }
  .macmillan-logo { margin-bottom: 16px; }
  .macmillan-logo img { max-width: 70vw; }
  .login-card { padding: 1.5rem 1rem; max-width: 320px; }
  .form-label { font-size: 14px; }
  .form-control { padding: .75rem .875rem; font-size: .95rem; }
  .btn-acessar { font-size: 18px; padding: .875rem; }
  .macmillan-footer { font-size: 10px; }
}
/* ===== FIX DEFINITIVO DO FOOTER NO MOBILE ===== */
@media (max-width: 768px) {
  .macmillan-hero {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 84px; /* espaço pro footer */
  }

  .macmillan-footer {
    position: static !important;     /* tira do absoluto */
    width: 100% !important;
    margin-top: auto;                /* empurra pro fim do container flex */
    padding: 12px 14px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;                 /* permite quebrar em várias linhas */
    gap: 6px 10px;
    justify-content: center;
    line-height: 1.4;
    white-space: normal;             /* quebra linhas longas */
  }

  .macmillan-footer a {
    display: inline;                 /* não força largura */
    white-space: normal;
    word-break: break-word;          /* se precisar, quebra palavras grandes */
  }

  /* garante que nada estoure a largura do viewport */
  html, body, .macmillan-hero, .macmillan-container, .login-card {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* ===== Footer fixo no mobile ===== */
@media (max-width: 540px) {
  /* reserva espaço para o footer fixo */
  .macmillan-hero {
    padding-bottom: 60px;                 /* evita que o footer cubra o card */
    min-height: 100dvh;                   /* vh dinâmico no mobile */
  }

  .macmillan-footer {
    position: fixed !important;           /* fica sempre visível */
    bottom: 0; left: 0; right: 0;
    z-index: 9;
    padding: 10px 14px;
    text-align: center;
    background: rgba(0,0,0,0.18);         /* leve contraste sobre a imagem */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    line-height: 1.35;
    white-space: normal;                  /* permite quebra de linha */
  }

  .macmillan-footer a {
    display: inline;
    margin: 0 6px 0 6px;
    word-break: break-word;
    color: rgba(255,255,255,0.95);
    text-decoration: underline;
    font-size: 12px;
  }
}