:root {
  --brand: #1a4d7c;
  --brand-hover: #123d63;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --err: #dc2626;
  --radius-input: 10px;
}

.auth-wrap {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sac-card {
  width: min(500px, 95%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  text-align: center;
}

.sac-header {
  background: #1e4b7a;
  padding: 40px 30px;
  color: #fff;
}

.sac-logo {
  max-width: 200px;
  height: auto;
  margin: 0 auto 15px;
  display: block;
  filter: brightness(0) invert(1);
}

@media (max-width: 480px) {
  .sac-header { padding: 30px 20px; }
  .sac-logo { max-width: 140px; margin-bottom: 12px; }
  .sac-title { font-size: 22px; }
  .sac-subtitle { font-size: 14px; }
}

.sac-title {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sac-subtitle {
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  line-height: 1.4;
  margin: 0 auto;
}

.sac-body {
  padding: 40px;
  background: #fff;
}

@media (max-width: 480px) {
  .sac-body { padding: 20px; }
}

.sac-form .form-group {
  margin-bottom: 15px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: #fff;
  position: relative;
  transition: border-color 0.2s;
  overflow: visible;
}

.sac-form .form-group:focus-within {
  border-color: var(--brand);
  z-index: 1001;
}

.sac-form .input-icon-box {
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-right: 1px solid var(--line);
  color: var(--brand);
  border-radius: 10px 0 0 10px;
  font-size: 18px;
  flex-shrink: 0;
}

.sac-form input {
  flex: 1;
  border: none !important;
  height: 52px;
  padding: 0 15px !important;
  font-size: 15px;
  color: #334155;
  background: transparent;
  outline: none;
}

@media (max-width: 480px) {
  .sac-form .form-group {
    flex-direction: row !important;
    align-items: stretch !important;
  }
  .sac-form .input-icon-box {
    width: 46px !important;
  }
}

.sac-btn {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #1e4b7a 0%, #15355a 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.sac-btn:hover {
  background: linear-gradient(135deg, #255c94 0%, #1e4b7a 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(30, 75, 122, 0.3);
}

.auth-feedback {
  min-height: 20px;
  margin: 0;
  color: var(--err);
  font-size: 14px;
  text-align: center;
  transition: color 0.2s ease;
}

.auth-feedback.is-loading {
  color: var(--brand);
  font-weight: 600;
}

.auth-feedback.is-error {
  color: var(--err);
}

.login-submit-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpinner 0.7s linear infinite;
}

.login-submit.is-loading .login-submit-icon {
  display: none;
}

.login-submit.is-loading .login-submit-spinner {
  display: block;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.9;
  transform: none;
  box-shadow: 0 4px 10px rgba(30, 75, 122, 0.2);
}

@keyframes loginSpinner {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .login-submit-spinner { animation-duration: 1.4s; }
}

.sac-btn-secondary {
  display: block;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  font-size: 13px;
}

.sac-footer-links {
  margin-top: 20px;
  font-size: 13px;
  color: #64748b;
}

.sac-page-footer {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}

.sac-page-footer a {
  color: #1e4b7a;
  text-decoration: none;
}

.sac-page-footer strong, .sac-page-footer .footer-brand {
  font-weight: 400;
  display: block;
  font-size: 13px;
  color: #64748b;
}

.sac-page-footer .footer-ccb {
  display: block;
  font-size: 13px;
  color: #1e4b7a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sac-page-footer .footer-region {
  display: block;
  font-size: 13px;
}

.auth-page { background:#f1f5f9; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif; margin:0; padding:0; }
.auth-lead { color:var(--muted); font-size:15px; line-height:1.55; margin:-4px 0 20px; }
.auth-back-link { display:inline-flex; align-items:center; gap:7px; margin-top:26px; color:var(--brand); font-size:13px; font-weight:600; text-decoration:none; }
.password-requirements { color:var(--muted); font-size:12px; line-height:1.5; margin:-3px 0 10px; text-align:left; }
.password-toggle { border:0; background:transparent; width:44px; color:#64748b; cursor:pointer; }
.auth-toast { position:fixed; z-index:3000; top:max(20px,env(safe-area-inset-top)); left:50%; display:flex; align-items:flex-start; gap:12px; width:min(390px,calc(100% - 32px)); box-sizing:border-box; padding:15px 16px; border-radius:12px; background:#fff; box-shadow:0 14px 35px rgba(15,23,42,.2); color:#334155; opacity:0; pointer-events:none; transform:translate(-50%,-18px); transition:opacity .22s ease,transform .22s ease; }
.auth-toast.is-visible { opacity:1; transform:translate(-50%,0); }
.auth-toast.is-success { border-left:5px solid #16a34a; } .auth-toast.is-error { border-left:5px solid var(--err); }
.auth-toast-icon { color:#16a34a; font-size:20px; line-height:1.1; } .auth-toast.is-error .auth-toast-icon { color:var(--err); }
.auth-toast-copy { flex:1; text-align:left; } .auth-toast-title { display:block; color:#1e293b; font-size:14px; margin-bottom:2px; }
.auth-toast-message { display:block; color:var(--muted); font-size:13px; line-height:1.4; }
@media(max-width:480px){.auth-wrap{padding:14px}.auth-lead{font-size:14px}}

/* Ajustes de fidelidade visual do fluxo de autenticação */
.auth-page .auth-wrap { min-height:100vh; box-sizing:border-box; padding-top:38px; padding-bottom:24px; }
.auth-page .sac-card { width:min(500px,calc(100% - 28px)); }
.auth-page .sac-page-footer { margin-top:20px; }
.login-forgot-link { color:#1e4b7a !important; font-weight:700; text-decoration:none; font-size:13px; }
/* Balance the login card and footer within the available screen. */
.login-page { min-height:100vh; min-height:100svh; display:flex; flex-direction:column; }
.login-page .auth-wrap {
  flex:1 0 auto;
  min-height:auto;
  box-sizing:border-box;
  padding:clamp(40px,10vh,100px) 20px 0;
  padding-top:max(env(safe-area-inset-top),clamp(40px,10svh,100px));
}
.login-page > .sac-page-footer { flex:none; margin:50px 20px max(28px,env(safe-area-inset-bottom)); }
.auth-toast { position:fixed; z-index:3000; inset:0; display:flex; align-items:center; justify-content:center; width:auto; box-sizing:border-box; padding:24px; background:rgba(31,41,55,.5); opacity:0; visibility:hidden; pointer-events:none; transform:none; transition:opacity .2s ease,visibility .2s ease; }
.auth-toast.is-visible { opacity:1; visibility:visible; pointer-events:auto; transform:none; }
.auth-toast-card { display:flex; flex-direction:column; align-items:center; justify-content:center; width:min(480px,100%); min-height:320px; box-sizing:border-box; padding:44px 38px 38px; border-radius:24px; background:#fff; box-shadow:0 18px 45px rgba(15,23,42,.22); text-align:center; }
.auth-toast.is-success,.auth-toast.is-error { border:0; }
.auth-toast-icon { display:flex; align-items:center; justify-content:center; width:82px; height:82px; box-sizing:border-box; margin-bottom:24px; border:4px solid #d9efcf; border-radius:50%; color:#98d77d; font-size:52px; font-weight:300; line-height:1; }
.auth-toast.is-error .auth-toast-icon { border-color:#fecaca; color:var(--err); }
.auth-toast-copy { display:block; text-align:center; }
.auth-toast-title { display:block; margin-bottom:36px; color:#1e293b; font-size:27px; font-weight:800; }
.auth-toast-message { display:block; max-width:350px; color:#6b7f9e; font-size:17px; line-height:1.55; }
.recovery-success { padding:10px 0 2px; color:#64748b; text-align:center; }
.recovery-success p { margin:0 0 8px; font-size:15px; line-height:1.5; }
.recovery-success small { display:block; color:#8aa0bd; font-size:13px; }
.recovery-success + .auth-back-link { margin-top:42px; }
@media(max-width:520px){
  .auth-toast-card{min-height:290px;padding:36px 24px;border-radius:20px}
  .auth-toast-title{font-size:24px;margin-bottom:28px}
  .auth-toast-message{font-size:16px}
  .auth-toast-icon{width:76px;height:76px;font-size:46px}
  .login-page > .sac-page-footer{margin-top:12px}
}

/* Proporções do botão de entrada conforme o modelo */
.login-page .auth-feedback:empty { display:none; min-height:0; }
.login-page .login-submit { margin-top:40px; }
.login-page .login-submit-icon { width:20px; height:20px; stroke:currentColor; stroke-width:12px; paint-order:stroke fill; }
.auth-back-icon { width:12px; height:14px; flex:0 0 auto; fill:currentColor; }

.login-page .login-submit-icon { width:16px; height:16px; fill:currentColor; stroke:none; paint-order:normal; }

/* Redefinição de senha no padrão visual do sistema */
.reset-page .auth-wrap { min-height:100vh; padding:32px 16px 22px; }
.reset-page .sac-card { width:min(500px,100%); overflow:hidden; }
.reset-page .sac-header { padding:38px 30px 36px; }
.reset-page .sac-logo { width:200px; max-width:200px; margin-bottom:16px; }
.reset-page .sac-body { padding:38px 40px 34px; }
.reset-page .auth-lead { margin:0 0 24px; }
.reset-page .input-icon-box .reset-lock-icon { width:16px; height:18px; fill:#1e4b7a; stroke:none; }
.reset-page .sac-form .form-group { margin-bottom:14px; overflow:hidden; }
.reset-page .password-requirements { margin:0 0 4px 2px; }
.reset-page .sac-btn { width:100%; margin-top:18px; }
.reset-page .reset-submit-icon { width:17px; height:17px; fill:currentColor; stroke:none; }
.reset-page .auth-back-link { margin-top:23px; }
.reset-page .sac-page-footer { margin-top:18px; }
@media(max-width:480px){.reset-page .auth-wrap{padding:14px 10px 20px}.reset-page .sac-header{padding:30px 20px}.reset-page .sac-logo{width:170px;max-width:170px}.reset-page .sac-body{padding:26px 18px 28px}}

/* Compact spacing for phones and short windows. */
@media (max-width:520px), (max-height:760px) {
  .login-page .auth-wrap {
    padding:28px 16px 0;
    padding-top:max(28px,env(safe-area-inset-top));
  }
  .login-page .login-submit { margin-top:24px; }
  .login-page > .sac-page-footer { margin-top:28px; margin-bottom:max(24px,env(safe-area-inset-bottom)); }
}

/* Feedback already provides spacing above the submit button. */
.login-page .auth-feedback:not(:empty) + .login-submit { margin-top:12px; }
