:root {
  --primary: #004B8D;
  --primary-dark: #003366;
  --secondary: #E4002B;
  --secondary-light: #ff1744;
  --text-dark: #1a1a1a;
  --text-light: #666666;
  --white: #ffffff;
  --background: #f8f9fa;
  --error: #E4002B;
  --success: #00A859;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--background);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.background-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background);
  background-image:
    radial-gradient(var(--primary) 1px, transparent 1px),
    radial-gradient(var(--primary) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

  .page-container {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .login-container {
    background: var(--white);
    border-radius: 24px;
    box-shadow:
      0 10px 40px rgba(0, 0, 0, 0.1),
      0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    position: relative;
    margin: 1rem;
    z-index: 1;
  }

  .login-header {
    text-align: center;
    margin-bottom: 2.5rem;
  }

  .login-header .logo-container {
    background: var(--primary);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 75, 141, 0.1);
  }

  .login-header img {
    height: 70px;
    margin-bottom: 0;
    filter: brightness(0) invert(1);
    max-width: 100%;
  }

  .login-header h1 {
    color: var(--primary);
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
  }

  .login-header p {
    color: var(--text-light);
    font-size: clamp(0.875rem, 3vw, 0.95rem);
    margin: 0;
    line-height: 1.5;
  }

  .btn-back {
    position: fixed;
    top: 1rem;
    left: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: clamp(0.875rem, 3vw, 0.95rem);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .btn-back:hover {
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }

  .btn-back:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .form-group {
    margin-bottom: 1.75rem;
    position: relative;
  }

  .form-group label {
    display: block;
    color: var(--text-dark);
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    font-weight: 500;
    margin-bottom: 0.5rem;
  }

  .form-group input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: clamp(0.9rem, 3vw, 1rem);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: var(--white);
    box-sizing: border-box;
  }

  .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 75, 141, 0.1);
    outline: none;
  }

  .form-group .icon {
    position: absolute;
    left: 1rem;
    top: 2.75rem;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: all 0.2s ease;
  }

  .form-group input:focus + .icon {
    color: var(--primary);
  }

  .btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 75, 141, 0.2);
  }

  .btn-login:active {
    transform: translateY(0);
    box-shadow: none;
  }

  .btn-login:disabled {
    background: rgba(0, 75, 141, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .spinner-border {
    width: 1.2rem;
    height: 1.2rem;
    display: none;
  }

  .alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    border: none;
  }

  .alert i {
    font-size: 1.1rem;
  }

  .alert-danger {
    background: rgba(228, 0, 43, 0.1);
    color: var(--error);
  }

  .alert-success {
    background: rgba(0, 168, 89, 0.1);
    color: var(--success);
  }

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

  .forgot-password {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid #e9ecef;
  }

  .forgot-password a {
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
  }

  .forgot-password a:hover {
    color: var(--secondary);
    background: rgba(0, 75, 141, 0.05);
  }

  .state-logo {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
  }

  .state-logo img {
    height: 45px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
  }

  .state-logo img:hover {
    opacity: 1;
  }

  .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  }

  .modal-header {
    background: var(--primary);
    color: var(--white);
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem;
  }

  .modal-header .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
  }

  .modal-header .close {
    color: var(--white);
    opacity: 0.8;
    text-shadow: none;
    transition: all 0.2s ease;
  }

  .modal-header .close:hover {
    opacity: 1;
    transform: rotate(90deg);
  }

  .modal-body {
    padding: 1.75rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-dark);
  }

  .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.25rem 1.5rem;
  }

  .btn-secondary {
    background: var(--text-light);
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
  }

  .btn-secondary:hover {
    background: var(--text-dark);
    transform: translateY(-1px);
  }

  @media (max-width: 480px) {
    .btn-back {
      position: absolute;
      top: 0.75rem;
      left: 0.75rem;
      padding: 0.5rem;
      width: 36px;
      height: 36px;
      justify-content: center;
      border-radius: 8px;
    }

    .btn-back span {
      display: none;
    }

    .btn-back i {
      margin: 0;
      font-size: 1.1rem;
    }

    .page-container {
      padding-top: 4rem;
    }

    .login-container {
      padding: 1.5rem;
      margin: 0.5rem;
      border-radius: 16px;
    }

    .login-header .logo-container {
      padding: 1.25rem;
    }

    .login-header img {
      height: 60px;
    }

    .form-group {
      margin-bottom: 1.25rem;
    }

    .form-group input {
      padding: 0.75rem 1rem 0.75rem 2.5rem;
    }
  }

  @media (max-width: 360px) {
    .login-container {
      padding: 1.25rem;
      margin: 0.25rem;
    }

    .login-header img {
      height: 50px;
    }
  }

  @media (min-width: 481px) and (max-width: 768px) {
    .login-container {
      padding: 2rem;
      margin: 0.75rem;
    }

    .btn-back {
      padding: 0.625rem 1.125rem;
    }
  }

  @media (min-height: 800px) {
    .page-container {
      padding: 3rem 1rem;
    }
  }