:root {
  /* Material Design 3 Color Tokens (Univesp Identity) */
  --md-sys-color-primary: #AF1D27;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #FFDAD6;
  --md-sys-color-on-primary-container: #410006;

  --md-sys-color-surface: #FDF8F8;
  --md-sys-color-on-surface: #1C1B1F;
  --md-sys-color-surface-variant: #F4DDDD;
  --md-sys-color-on-surface-variant: #49454F;

  --md-sys-color-outline: #857373;

  --md-sys-color-surface-container: #F3EDEF;
  --md-sys-color-surface-container-high: #ECE6E8;

  /* Custom Identity Colors */
  --color-univesp-red: #AF1D27;
  --color-univesp-dark-red: #8B121A;
  --color-univesp-bg-item: #A01B24;
  --color-univesp-divider: #FFFFFF;

  /* Typography Scale */
  --md-sys-typescale-display-small-size: 24px;
  /* Was 28pt (~37px) */
  --md-sys-typescale-headline-medium-size: 20px;
  /* Was 20pt (~26px) */
  --md-sys-typescale-body-large-size: 16px;
  /* Was 14pt-16px */
  --md-sys-typescale-label-large-size: 14px;

  /* Shapes */
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-small: 8px;

  /* Elevations */
  --md-sys-elevation-level3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px rgba(0, 0, 0, 0.3);

  /* Motions */
  --md-sys-motion-duration-medium: 250ms;
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0.0, 0, 1.0);
}

body {
  background-image: url('../assets/background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  /* Parallax feel */
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

.main-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  /* Modern glass effect on background */
  background-color: rgba(0, 0, 0, 0.3);
  /* Overlay for readability */
}

/* Base Card Container */
.option-box,
.optionbox {
  width: 420px;
  /* narrowed from 510px for better proportions */
  max-width: 90%;
  height: auto;
  background-color: var(--color-univesp-red);
  display: flex;
  flex-direction: column;
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-level3);
  overflow: hidden;
  /* Clip children to radius */
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.optionbox {
  background-color: transparent;
  /* For the menu items wrapper */
  box-shadow: none;
}

/* Header / Title */
.option-title {
  font-family: 'Barlow', sans-serif;
  color: var(--md-sys-color-on-primary);
  width: 100%;
  padding: 24px 0;
  /* Responsive padding instead of fixed height */
  font-size: var(--md-sys-typescale-display-small-size);
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.1);
  /* Subtle separation */
  letter-spacing: 0.5px;
}

.option-title>p {
  margin: 0;
}

.option-title>p>span {
  font-weight: 800;
  /* Extra bold */
}

.barra-separacao {
  width: 100%;
  height: 5px;
  /* height: 1px; */
  /* Thinner for modern look */
  background-color: rgba(0, 0, 0, 0.2);
}

/* Menu Items */
.option-item {
  font-family: 'Montserrat', sans-serif;
  width: 100%;
  padding: 10px 0px;
  /* Replaces fixed height 95px */
  background-color: var(--color-univesp-bg-item);
  color: var(--md-sys-color-on-primary);
  font-weight: 550;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: var(--md-sys-typescale-headline-medium-size);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
  position: relative;
  overflow: hidden;
  /* For ripple effect ideally, but simple hover for now */
}

.option-item:hover {
  background-color: var(--color-univesp-dark-red);
  padding-left: 20px;
  /* Dynamic movement suggestion */
}

.option-item:last-child:hover {
  background-color: var(--md-sys-color-on-primary-container);
  padding-left: 20px;
  /* Dynamic movement suggestion */
}

/* Top/Bottom radius for grouping */
.option-item:first-child {
  border-top-left-radius: var(--md-sys-shape-corner-extra-large);
  border-top-right-radius: var(--md-sys-shape-corner-extra-large);
}

.option-item:last-child {
  border-bottom-left-radius: var(--md-sys-shape-corner-extra-large);
  border-bottom-right-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--color-univesp-dark-red);
}

.item-separacao {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  /* Softer divider */
}

/* Image/Logo Box */
.image-box {
  margin-top: 48px;
  transition: transform 0.3s ease;
}

.image-box:hover {
  transform: scale(1.05);
}

/* Login Specifics */
.ava-item {
  font-family: 'Montserrat', sans-serif;
  padding: 24px 16px;
  /* background-color: var(--color-univesp-bg-item); */
  background-color: #770f1b;
  /*background-color: var(--color-univesp-red);*/
  color: var(--md-sys-color-on-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--md-sys-typescale-body-large-size);
}

.ava-item>p {
  text-align: center;
  font-weight: 400;
  /* Lighter weight */
  line-height: 1.4;
  margin: 0;
}

.login-container {
  width: 100%;
  padding: 24px 0 32px 0;
  background-color: var(--md-sys-color-surface);
  border-bottom-left-radius: var(--md-sys-shape-corner-extra-large);
  border-bottom-right-radius: var(--md-sys-shape-corner-extra-large);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-title {
  font-family: 'Montserrat', sans-serif;
  color: var(--md-sys-color-on-surface);
  text-transform: uppercase;
  margin-bottom: 24px;
  font-size: var(--md-sys-typescale-body-large-size);
  letter-spacing: 0.5px;
}

.login-title>p>span {
  font-weight: 700;
  color: var(--color-univesp-red);
}

/* Updated Login Input Container for MD3 */
.login-input-container {
  width: 80%;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
  /* Replaces existing margin on login-input */
}

.login-input {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* Takes full width of container */
  height: 56px;
  /* MD3 Standard height */
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline);
  overflow: hidden;
  transition: all 0.2s var(--md-sys-motion-easing-emphasized);
  position: relative;
}

.login-input:focus-within {
  box-shadow: 0 0 0 2px var(--color-univesp-red);
  border-color: var(--color-univesp-red);
  background-color: #FFFFFF;
}

.icone-imagem-box {
  background-color: transparent;
  width: 48px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.icone-imagem-box>img {
  width: 24px;
  height: 24px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.input-box {
  flex: 1;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.input-box>input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: var(--md-sys-typescale-body-large-size);
  font-family: 'Montserrat', sans-serif;
  outline: none;
  padding: 20px 10px 6px 0px;
  /* Push text down to make room for label */
  z-index: 1;
}

/* Floating Label Styles */
.floating-label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--md-sys-color-on-surface-variant);
  pointer-events: none;
  transition: all 0.2s var(--md-sys-motion-easing-emphasized);
  font-size: var(--md-sys-typescale-body-large-size);
  font-family: 'Montserrat', sans-serif;
  z-index: 2;
  /* Ensure label is visible */
}

/* Float Up State */
.input-box>input:focus~.floating-label,
.input-box>input:not(:placeholder-shown)~.floating-label {
  top: 8px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--color-univesp-red);
  font-weight: 600;
}

/* Error State Styles */
.login-input.error-state {
  border-color: var(--color-univesp-bg-item);
  box-shadow: 0 0 0 2px rgba(175, 29, 39, 0.2);
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
  background-color: #FFF8F8;
}

.login-input.error-state .input-box>input:focus~.floating-label,
.login-input.error-state .input-box>input:not(:placeholder-shown)~.floating-label {
  color: var(--color-univesp-bg-item);
}

.login-input.error-state .icone-imagem-box>img {
  filter: invert(15%) sepia(95%) saturate(100%) hue-rotate(358deg) brightness(95%) contrast(112%);
  opacity: 1;
}

/* Helper Text */
.helper-text {
  margin-top: 6px;
  margin-left: 12px;
  font-size: 12px;
  color: var(--color-univesp-bg-item);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s var(--md-sys-motion-easing-emphasized);
  height: 0;
  /* Prevent layout shift when hidden */
}

.helper-text:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  height: auto;
}

.error-icon {
  font-size: 14px;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

.login-button {
  width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-button>button {
  width: 100%;
  height: 48px;
  background-color: #F0F0F0;
  border: 3px solid #383838;
  color: #383838;
  text-transform: uppercase;
  font-weight: 600;
  font-size: var(--md-sys-typescale-label-large-size);
  border-radius: 100px;
  /* Pill shape */
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;

  &:hover {
    background-color: #383838;
    color: #F0F0F0;
  }
}

/* login-button 
.login-button>button {
  width: 100%;
  height: 48px;
  /* Touch target size */
/*
  background-color: var(--color-univesp-red);
  border: none;
  color: var(--md-sys-color-on-primary);
  text-transform: uppercase;
  font-weight: 600;
  font-size: var(--md-sys-typescale-label-large-size);
  border-radius: 100px;
  /* Pill shape */
/*
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
}
*/

.login-button>button:hover {
  background-color: var(--md-sys-color-on-surface-variant);
  /*background-color: var(--color-univesp-dark-red);*/
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

::placeholder {
  text-align: left;
  opacity: 0.5;
}

@media (max-width: 576px) {

  .option-box,
  .optionbox {
    width: 90%;
  }

  .option-title {
    font-size: 20px;
  }

  .option-item {
    font-size: 18px;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.6s var(--md-sys-motion-easing-emphasized);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Helper Classes for HTML Cleanup */
.user-session {
  display: none;
  color: #FFFFFF;
  /* White text for contrast against background */
  margin-bottom: 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
  font-weight: 500;
}

.btn-text {
  margin-top: 14px !important;
  background: transparent !important;
  border: none !important;
  color: var(--md-sys-color-on-surface) !important;
  font-size: var(--md-sys-typescale-label-large-size) !important;
  text-transform: none !important;
  height: auto !important;
  text-decoration: underline !important;
  box-shadow: none !important;
  width: auto !important;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--color-univesp-red) !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.logout-text {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  margin: 0;
}