:root {
  --ink: #171a1f;
  --muted: #6b7280;
  --cream: #fff8e8;
  --paper: #fffdf7;
  --gold: #f6be2c;
  --gold-deep: #bb8215;
  --forest: #26392f;
  --line: rgba(54, 43, 23, 0.14);
  --danger: #b42318;
  --success: #16784f;
  --shadow: 0 28px 80px rgba(25, 23, 18, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eadfcd;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 10% 12%, rgba(246, 190, 44, 0.34), transparent 28rem),
    radial-gradient(circle at 88% 85%, rgba(38, 57, 47, 0.18), transparent 30rem),
    linear-gradient(135deg, #f8f1e1 0%, #e8dcc9 46%, #f6efe1 100%);
  overflow-x: hidden;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
  position: relative;
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.login-shell::before {
  width: 360px;
  height: 360px;
  left: -120px;
  bottom: -130px;
  background: rgba(246, 190, 44, 0.18);
  filter: blur(2px);
}

.login-shell::after {
  width: 420px;
  height: 420px;
  right: -160px;
  top: -150px;
  background: rgba(23, 26, 31, 0.08);
}

.login-frame {
  width: min(1080px, 100%);
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 34px;
  background: rgba(255, 253, 247, 0.72);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(22px);
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: clamp(28px, 4vw, 52px);
  color: #fffdf7;
  background:
    linear-gradient(155deg, rgba(23, 26, 31, 0.96), rgba(38, 57, 47, 0.92)),
    radial-gradient(circle at 22% 20%, rgba(246, 190, 44, 0.38), transparent 18rem);
  overflow: hidden;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(135deg, black, transparent 78%);
  pointer-events: none;
}

.hero-brand,
.hero-copy,
.hero-metrics {
  position: relative;
  z-index: 1;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-logo {
  width: 170px;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 22px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.hero-brand span {
  display: block;
  color: rgba(255, 253, 247, 0.62);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-brand strong {
  color: #fff8e8;
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 3px;
}

.hero-copy {
  max-width: 550px;
  margin: 70px 0;
}

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #ffe29a;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy .eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--gold);
}

.hero-copy h1 {
  margin: 0;
  color: #fffdf7;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.92;
}

.hero-copy p {
  max-width: 460px;
  margin: 22px 0 0;
  color: rgba(255, 253, 247, 0.68);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
}

.metric-card i {
  color: #ffe29a;
  font-size: 1rem;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: #fff8e8;
  font-size: 1.15rem;
  font-weight: 800;
}

.metric-card span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 253, 247, 0.58);
  font-size: 0.78rem;
  line-height: 1.35;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 4vw, 52px);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 248, 232, 0.9));
}

.panel-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(187, 130, 21, 0.18);
  border-radius: 999px;
  background: #fff4cf;
  color: #7b570f;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-title {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.panel-subtitle {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

#flash-messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash-message,
.flash-success,
.flash-error,
.flash-warning,
.flash-info,
.flash-danger {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 10px 22px rgba(23, 26, 31, 0.05);
}

.flash-success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.flash-error,
.flash-danger {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: var(--danger);
}

.flash-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.flash-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.flash-close {
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.72;
}

.flash-close {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.flash-message.is-fading-out {
  animation: fadeOut 0.5s forwards;
}

.is-hidden {
  display: none !important;
}

.is-visible {
  display: block !important;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: #393326;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.input-shell {
  position: relative;
}

.input-shell i {
  position: absolute;
  left: 16px;
  top: 50%;
  color: #9b875e;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px 0 46px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.login-input:focus {
  border-color: rgba(187, 130, 21, 0.6);
  background: #ffffff;
  box-shadow: 0 0 0 5px rgba(246, 190, 44, 0.17);
}

.login-input::placeholder {
  color: #a79b88;
  font-weight: 600;
}

.login-button {
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8cf57, #d89a20);
  color: #1c1710;
  cursor: pointer;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 900;
  box-shadow: 0 18px 30px rgba(216, 154, 32, 0.25);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px rgba(216, 154, 32, 0.32);
  filter: saturate(1.08);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.support-box {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(38, 57, 47, 0.12);
  border-radius: 20px;
  background: rgba(38, 57, 47, 0.05);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.support-box strong {
  color: var(--forest);
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.login-footer {
  margin-top: 22px;
  color: #8b8172;
  font-size: 0.76rem;
  text-align: center;
}

@media (max-width: 900px) {
  .login-frame {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    padding: 26px;
  }

  .hero-copy {
    margin: 34px 0 28px;
  }

  .hero-copy p {
    max-width: none;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .login-shell {
    padding: 12px;
  }

  .login-frame {
    border-radius: 24px;
  }

  .login-hero {
    padding: 20px;
  }

  .hero-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .hero-copy {
    margin: 26px 0 0;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 14vw, 2.8rem);
  }

  .hero-copy p,
  .hero-metrics {
    display: none;
  }

  .login-panel {
    padding: 22px;
  }

  .panel-title {
    font-size: 1.7rem;
  }
}

.modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(246, 190, 44, 0.24), transparent 24rem),
    rgba(23, 26, 31, 0.68);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  animation: fadeIn 0.25s ease-out;
  backdrop-filter: blur(8px);
}

.modal.is-closing {
  animation: fadeOut 0.3s ease-out;
}

.modal-content {
  background: linear-gradient(180deg, #fffdf7, #fff8e8);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  box-shadow: 0 28px 80px rgba(25, 23, 18, 0.28);
  max-width: 520px;
  width: min(100%, 520px);
  max-height: 88vh;
  overflow-y: auto;
  animation: slideIn 0.28s ease-out;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #171a1f, #26392f);
  color: #fff8e8;
}

.modal-header h3 {
  margin: 0;
  color: #fff8e8;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.close-modal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffe29a;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  line-height: 1;
}

.close-modal:hover {
  background: rgba(255, 226, 154, 0.18);
  color: #fff8e8;
}

.modal-body {
  padding: 24px;
  color: #423a2d;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
  color: #393326;
  font-size: 0.82rem;
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(54, 43, 23, 0.16);
  border-radius: 15px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #171a1f;
  background: rgba(255, 255, 255, 0.8);
  box-sizing: border-box;
}

.form-control:focus {
  border-color: rgba(187, 130, 21, 0.65);
  outline: none;
  box-shadow: 0 0 0 5px rgba(246, 190, 44, 0.16);
}

.form-text {
  font-size: 0.76rem;
  margin-top: 6px;
  display: block;
}

.text-muted {
  color: #7c725f;
}

.btn {
  min-height: 46px;
  padding: 10px 17px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #f8cf57, #d89a20);
  color: #1c1710;
  box-shadow: 0 14px 28px rgba(216, 154, 32, 0.22);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(216, 154, 32, 0.3);
}

.btn-secondary {
  background: #f1eadc;
  color: #423a2d;
}

.btn-secondary:hover:not(:disabled) {
  background: #e4d8c3;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.caixa-message {
  padding: 0 24px 24px;
}

.modal-feedback {
  margin-top: 15px;
}

@media (max-width: 560px) {
  .modal {
    align-items: flex-end;
    padding: 10px;
  }

  .modal-content {
    border-radius: 24px 24px 0 0;
    width: 100%;
  }

  .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideIn {
  from {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
