﻿@import url('admin.css');

:root {
  --primary: #4D6421; /* Deep Green */
  --primary-lime: #BFFF00; /* Vibrant Lime */
  --bg-light: #F8FCE5;
  --text-dark: #191D10;
  --text-muted: #434933;
  --white: #FFFFFF;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: inherit;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* Impede zoom e rolagem lateral */
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f8fce5 0%, #eef3d5 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

img {
  max-width: 100%;
  height: auto;
}

.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100vh;
}

/* --- Lado Esquerdo (Branding Desktop) --- */
.branding-side {
  padding: 40px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 10;
}

.brand-identity {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-logo { width: 90px; }
.main-slogan { width: 180px; }

.hero-message h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.hero-message p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 400px;
}

/* Classes de Controle */
.mobile-only { display: none !important; }
.student-mobile-box { display: none; }
.mobile-only-header { display: none; }

/* --- Lado Direito (Login Side Desktop) --- */
.login-side {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lime-shape {
  position: absolute;
  top: 0;
  right: -5%;
  width: 110%;
  height: 100%;
  background: var(--primary-lime);
  border-radius: 200px 0 0 200px;
  transform: rotate(-3deg) translateY(5%);
  z-index: 1;
}

.auth-card {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  border-radius: 40px;
  box-shadow: 0 40px 100px rgba(77, 100, 33, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.auth-card header { margin-bottom: 24px; }
.auth-card header h2 {
  font-size: 28px;
  font-weight: 800;
  color: #000;
  margin-bottom: 4px;
  letter-spacing: -1px;
}
.auth-card header p { color: var(--text-muted); font-size: 14px; }

/* Estrutura de Campo Unificada */
.input-group { margin-bottom: 20px; }
.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #434933; /* Cor mais equilibrada */
  margin-bottom: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.field-wrapper { 
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 0 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.field-wrapper:focus-within {
  border-color: var(--primary-lime);
  box-shadow: 0 0 0 4px rgba(191, 255, 0, 0.15);
  background: #fff;
}

.field-wrapper i {
  color: #94a3b8;
  width: 20px;
  height: 20px;
  margin-right: 28px;
  flex-shrink: 0;
  transition: color 0.3s;
}

.field-wrapper:focus-within i {
  color: var(--primary);
}

.field-wrapper input {
  width: 100%;
  padding: 14px 10px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  outline: none;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 0 4px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

.forgot-pw {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.btn-submit {
  width: 100%;
  background: var(--primary-lime);
  color: var(--primary);
  border: none;
  padding: 16px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(191, 255, 0, 0.3);
}

.card-footer {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(0,0,0,0.06);
  text-align: center;
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
}

/* Animação */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-entrance { animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* =========================================
   MOBILE DESIGN (Encaixe Perfeito)
   ========================================= */
@media (max-width: 1024px) {
  body {
    background: linear-gradient(180deg, var(--primary-lime) 0%, var(--bg-light) 40%);
    overflow-y: auto;
    display: block;
    height: auto;
    width: 100%;
  }

  .login-page {
    grid-template-columns: 1fr;
    height: auto;
    width: 100%;
    padding-bottom: 60px;
  }

  .desktop-only { display: none !important; }
  .desktop-only-h1 { display: none !important; }
  .desktop-only-p { display: none !important; }
  .mobile-only { display: block !important; }
  .mobile-only-header { display: block !important; }

  .branding-side {
    padding: 60px 24px 20px 24px;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .brand-identity {
    margin-bottom: 24px;
    align-items: center;
    width: 100%;
  }

  .main-logo { width: 100px; max-width: 80%; }

  .student-mobile-box {
    display: flex !important;
    justify-content: center;
    margin-bottom: 32px;
    width: 100%;
  }

  .student-img {
    width: 280px;
    max-width: 90%;
    filter: drop-shadow(0 20px 40px rgba(77, 100, 33, 0.1));
    /* Suaviza o corte da imagem na base */
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  }

  .hero-message {
    margin-bottom: 0; /* Totalmente encostado no card */
  }

  .mobile-only-header h1 {
    font-size: clamp(28px, 8vw, 42px); /* Ligeiramente menor para caber em uma linha */
    font-weight: 800;
    color: #191d10;
    margin-bottom: 12px;
    letter-spacing: -1px;
    white-space: nowrap; /* Impede a quebra de linha */
  }

  .system-badge {
    display: inline-block;
    background: rgba(77, 100, 33, 0.05);
    color: var(--primary);
    padding: 8px 24px;
    border-radius: 100px;
    font-size: 10px; /* Reduzi um pouco para garantir linha única */
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap; /* Impede a quebra de linha */
  }

  .login-side {
    padding: 0 20px;
    width: 100%;
  }

  .lime-shape { display: none; }

  .auth-card {
    position: relative;
    overflow: hidden; /* Para conter a decoração */
    background: #ffffff;
    border-radius: 60px;
    width: 100%;
    max-width: 100%;
    padding: 64px 24px 32px 24px;
    box-shadow: 0 20px 60px rgba(77, 100, 33, 0.08);
  }

  .auth-card .card-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 140px; /* Aumentado para 140px como solicitado */
    height: 140px;
    background: #f1fcc9;
    border-radius: 0 0 0 100%;
    z-index: 1;
    pointer-events: none;
  }

  .auth-card > * { position: relative; z-index: 10; } /* Garante que conteúdo fique acima da decoração */

  .auth-card header { display: none; }

  .field-wrapper {
    padding: 0 16px;
    border-radius: 14px;
  }

  .field-wrapper i {
    margin-right: 28px; /* Mesma distância do desktop */
  }

  .field-wrapper input {
    padding: 16px 10px; /* Mesmo respiro do desktop */
    font-size: 15px;
  }

  .btn-submit {
    padding: 22px;
    font-size: 24px;
    letter-spacing: 4px;
    font-weight: 500;
    text-transform: uppercase;
  }

  .remember-me {
    color: #191d10;
    font-weight: 700;
  }

  .forgot-pw {
    color: #4b6700;
    font-weight: 700;
  }

  .help-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    background: rgba(77, 100, 33, 0.05);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin: 32px auto;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 32px;
    width: 100%;
  }

  .mobile-slogan img {
    width: 240px;
    max-width: 80%;
    opacity: 0.8;
  }
}

/* =========================================
   LOGIN MOBILE - PEGADA ESCOLA CANAA
   ========================================= */
@media (max-width: 1024px) {
  body.auth-login-body {
    min-height: 100svh;
    display: block;
    overflow-x: hidden;
    background: #f8fbef;
  }

  body.auth-login-body .portal-login {
    position: relative;
    min-height: 100svh;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 22px;
    overflow: hidden;
    background:
      radial-gradient(circle at 52% 24%, rgba(77, 100, 33, 0.08), transparent 29%),
      radial-gradient(circle at 18% 10%, rgba(197, 232, 26, 0.18), transparent 24%),
      linear-gradient(180deg, #ffffff 0%, #f8fbef 54%, #ffffff 100%);
  }

  body.auth-login-body .portal-login::before {
    content: "";
    position: absolute;
    inset: 24px 14px auto;
    height: 300px;
    z-index: 0;
    opacity: 0.38;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='430' height='300' viewBox='0 0 430 300' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='%23DDE8C6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M40 92c28-13 48-12 72 4V52c-23-14-45-14-72-1v41Z'/%3E%3Cpath d='M112 96c25-16 48-18 72-5V49c-23-12-46-11-72 3v44Z'/%3E%3Cpath d='M310 67l48 19-11 29-48-20 11-28Z'/%3E%3Cpath d='M358 86l20 8-11 29-20-8'/%3E%3Cpath d='M305 206l70-37 69 37-69 36-70-36Z'/%3E%3Cpath d='M158 42l19-39 18 39 43 6-31 30 7 42-37-20-38 20 8-42-32-30 43-6Z'/%3E%3Cpath d='M46 237c22 3 37 18 39 42 2-24 17-39 39-42-22-4-37-19-39-43-2 24-17 39-39 43Z'/%3E%3Cpath d='M232 51c18 4 26 13 28 29' stroke-dasharray='8 10'/%3E%3Cpath d='M281 37c24-4 43 5 55 26' stroke-dasharray='8 10'/%3E%3Cpath d='M64 174c-28 26-34 55-17 88' stroke-dasharray='8 10'/%3E%3Cpath d='M355 138c30 18 41 45 31 78' stroke-dasharray='8 10'/%3E%3C/g%3E%3C/svg%3E");
  }

  body.auth-login-body .portal-login::after {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -1px;
    height: 154px;
    z-index: 0;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center bottom;
    background-image: url("data:image/svg+xml,%3Csvg width='430' height='154' viewBox='0 0 430 154' preserveAspectRatio='none' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23C5E81A' d='M148 96C215 50 285 31 356 47C389 54 414 67 430 79V154H0V136C52 122 99 128 148 96Z'/%3E%3Cpath fill='%234D6421' d='M0 52C73 73 127 105 195 97C261 89 310 61 372 79C394 85 413 96 430 110V154H0V52Z'/%3E%3Cpath fill='%236F871C' opacity='.42' d='M0 72C81 99 134 120 207 107C274 95 319 73 382 91C402 97 418 107 430 118V154H0V72Z'/%3E%3C/svg%3E");
  }

  body.auth-login-body .branding-side {
    position: relative;
    z-index: 2;
    min-height: auto;
    width: 100%;
    padding: calc(28px + env(safe-area-inset-top)) 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  body.auth-login-body .content-wrapper {
    min-height: auto;
    width: 100%;
    max-width: 430px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  body.auth-login-body .brand-identity {
    width: 100%;
    margin: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.auth-login-body .main-logo {
    width: 196px;
    max-width: 64vw;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 18px 30px rgba(77, 100, 33, 0.16));
  }

  body.auth-login-body .main-slogan,
  body.auth-login-body .student-mobile-box,
  body.auth-login-body .desktop-only-h1,
  body.auth-login-body .desktop-only-p,
  body.auth-login-body .lime-shape,
  body.auth-login-body .auth-card .card-decoration {
    display: none !important;
  }

  body.auth-login-body .hero-message {
    width: 100%;
    text-align: center;
    margin: 0;
  }

  body.auth-login-body .mobile-only-header {
    display: block !important;
  }

  body.auth-login-body .mobile-only-header h1 {
    color: #26330b;
    font-size: 44px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 0 14px;
    white-space: normal;
  }

  body.auth-login-body .mobile-only-header h1 {
    font-size: 0;
  }

  body.auth-login-body .mobile-only-header h1::before {
    content: "Bem-vindo!";
    font-size: 44px;
  }

  body.auth-login-body .system-badge {
    display: block;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #667052;
    box-shadow: none;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    white-space: normal;
    font-size: 0;
  }

  body.auth-login-body .system-badge::before {
    content: "Acesse sua conta para continuar";
    font-size: 18px;
  }

  body.auth-login-body .login-side {
    position: relative;
    z-index: 2;
    width: 100%;
    flex: 1;
    min-height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 0 calc(138px + env(safe-area-inset-bottom));
    margin: 0;
  }

  body.auth-login-body .login-side::after {
    content: "Educare, mais que ensino.";
    white-space: nowrap;
    position: absolute;
    left: 10px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 3;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.20);
  }

  body.auth-login-body .auth-card {
    width: min(100%, 430px);
    max-width: 430px;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
  }

  body.auth-login-body .auth-card::before,
  body.auth-login-body .auth-card header {
    display: none;
  }

  body.auth-login-body .auth-card > * {
    position: relative;
    z-index: 4;
  }

  body.auth-login-body .input-group {
    margin-bottom: 15px;
  }

  body.auth-login-body .input-group label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  body.auth-login-body .field-wrapper {
    min-height: 72px;
    padding: 0 22px;
    border-radius: 16px;
    border: 1px solid rgba(77, 100, 33, 0.13);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 30px rgba(77, 100, 33, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    gap: 20px;
  }

  body.auth-login-body .field-wrapper:focus-within {
    border-color: rgba(77, 100, 33, 0.36);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(197, 232, 26, 0.22), 0 16px 34px rgba(77, 100, 33, 0.09);
  }

  body.auth-login-body .field-wrapper i {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    margin-right: 0;
    color: #4d6421;
    opacity: 1;
  }

  body.auth-login-body .field-wrapper input {
    color: #1f2a12;
    padding: 18px 0;
    font-size: 17px;
    font-weight: 500;
  }

  body.auth-login-body .field-wrapper input::placeholder {
    color: #707a62;
  }

  body.auth-login-body .form-options {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
    margin: 20px 0 26px;
  }

  body.auth-login-body .remember-me {
    color: #1f2a12;
    font-size: 15px;
    font-weight: 600;
    gap: 10px;
  }

  body.auth-login-body .remember-me input {
    width: 20px;
    height: 20px;
    accent-color: #4d6421;
  }

  body.auth-login-body .forgot-pw {
    color: #4d6421;
    font-size: 15px;
    font-weight: 700;
  }

  body.auth-login-body .btn-submit {
    min-height: 70px;
    padding: 0 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4d6421 0%, #6f871c 100%);
    color: #ffffff;
    border: 0;
    box-shadow: 0 20px 34px rgba(77, 100, 33, 0.24);
    text-transform: none;
    letter-spacing: 0;
    font-size: 20px;
    font-weight: 800;
  }

  body.auth-login-body .btn-submit span {
    font-size: 0;
  }

  body.auth-login-body .btn-submit span::before {
    content: "Entrar";
    font-size: 20px;
  }

  body.auth-login-body .login-form + div[style*="text-align: center"] {
    position: relative;
    margin-top: 34px !important;
    padding-top: 38px !important;
    background:
      linear-gradient(rgba(77, 100, 33, 0.16), rgba(77, 100, 33, 0.16)) left top / calc(50% - 34px) 1px no-repeat,
      linear-gradient(rgba(77, 100, 33, 0.16), rgba(77, 100, 33, 0.16)) right top / calc(50% - 34px) 1px no-repeat;
  }

  body.auth-login-body .login-form + div[style*="text-align: center"]::before {
    content: "ou";
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    color: #667052;
    font-size: 16px;
    font-weight: 600;
    text-transform: lowercase;
  }

  body.auth-login-body .login-form + div[style*="text-align: center"] p {
    display: none;
  }

  body.auth-login-body .login-form + div[style*="text-align: center"] a {
    width: 100%;
    min-height: 64px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 20px !important;
    border-radius: 16px !important;
    border: 1.8px solid #c5e81a !important;
    background: rgba(255, 255, 255, 0.78) !important;
    color: #4d6421 !important;
    box-shadow: 0 14px 28px rgba(197, 232, 26, 0.13) !important;
    font-size: 0 !important;
    font-weight: 800 !important;
  }

  body.auth-login-body .login-form + div[style*="text-align: center"] a::before {
    content: "Entrar como Responsavel";
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  body.auth-login-body .portal-login {
    padding-left: 18px;
    padding-right: 18px;
  }

  body.auth-login-body .portal-login::before {
    left: 8px;
    right: 8px;
    height: 276px;
  }

  body.auth-login-body .branding-side {
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-bottom: 16px;
  }

  body.auth-login-body .brand-identity {
    margin-bottom: 18px;
  }

  body.auth-login-body .main-logo {
    width: 184px;
    max-width: 62vw;
  }

  body.auth-login-body .login-side {
    padding-top: 22px;
  }

  body.auth-login-body .mobile-only-header h1::before {
    font-size: 40px;
  }
}

@media (max-width: 370px) {
  body.auth-login-body .portal-login {
    padding-left: 14px;
    padding-right: 14px;
  }

  body.auth-login-body .mobile-only-header h1::before {
    font-size: 34px;
  }

  body.auth-login-body .system-badge::before {
    font-size: 16px;
  }

  body.auth-login-body .form-options {
    align-items: flex-start;
    flex-direction: column;
  }

  body.auth-login-body .field-wrapper {
    min-height: 66px;
  }
}

/* Login mobile v9: identidade empilhada, compacta e sem disputa entre regras antigas. */
@media (max-width: 1024px) {
  body.auth-login-body .content-wrapper {
    flex-direction: column;
    justify-content: center;
  }

  body.auth-login-body .branding-side {
    padding-top: calc(22px + env(safe-area-inset-top));
    padding-bottom: 10px;
  }

  body.auth-login-body .brand-identity {
    margin: 0 0 10px;
  }

  body.auth-login-body .main-logo {
    width: 144px;
    max-width: 42vw;
    filter: drop-shadow(0 14px 24px rgba(77, 100, 33, 0.13));
  }

  body.auth-login-body .hero-message {
    display: block;
    width: 100%;
    text-align: center;
  }

  body.auth-login-body .mobile-only-header h1 {
    margin: 0 0 7px;
    line-height: 1.08;
    white-space: nowrap;
  }

  body.auth-login-body .mobile-only-header h1::before {
    display: block;
    font-size: clamp(32px, 9vw, 39px);
    letter-spacing: -1.4px;
  }

  body.auth-login-body .system-badge::before {
    font-size: clamp(14px, 4.1vw, 17px);
  }

  body.auth-login-body .login-side {
    padding-top: 16px;
  }
}

@media (max-width: 520px) {
  body.auth-login-body .portal-login {
    padding-left: 16px;
    padding-right: 16px;
  }

  body.auth-login-body .branding-side {
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: 8px;
  }

  body.auth-login-body .main-logo {
    width: 130px;
    max-width: 39vw;
  }

  body.auth-login-body .field-wrapper {
    min-height: 66px;
  }

  body.auth-login-body .login-side {
    padding-top: 14px;
  }
}

@media (max-width: 370px) {
  body.auth-login-body .main-logo {
    width: 116px;
  }

  body.auth-login-body .mobile-only-header h1::before {
    font-size: 31px;
  }
}


