:root {
  --primary-color: #387fca;
  --primary-hover: #387fca;
  --bg-gradient-start: #eef2ff;
  --bg-gradient-end: #e0e7ff;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'Gabarito';
  src: url('/asset/fonts/Gabarito-VariableFont_wght.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

input[type="password"]::-ms-reveal, 
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button, 
input[type="password"]::-webkit-clear-button,
input[type="password"]::-webkit-inner-spin-button {
  display: none !important;
  appearance: none;
}

html, body {
  height: 100%;
  overflow: hidden;
  position: fixed;
  width: 100%;
  touch-action: manipulation;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
}

.bg-gradient {
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  min-height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.login-card {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 440px;
  margin: auto;
  position: relative;
  border: none;
  max-height: 95%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.container-fluid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  height: 100%;
  margin-top: -25px;
}

.card-body {
  padding: 2rem;
}

.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.logo img {
  max-width: 200px;
  height: auto;
}

.mt-2 {
  letter-spacing: 1px;
  color: gray;
}

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

.form-label {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: rgb(114, 114, 114);
  display: block;
  margin-bottom: 5px;
}

.logo-container svg {
  width: 48px;
  height: 48px;
  color: var(--primary-color);
}

.input-group {
  position: relative;
  display: flex;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d0d5dd;
  overflow: hidden;
}

.input-group:focus-within .input-group-text {
  border-color: var(--primary-color);
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  border-right: 1px solid #d0d5dd;
  font-size: 0.95rem;
}

.form-control {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  font-size: 0.95rem;
  width: 100%;
}

.form-control:focus {
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  border-color: var(--primary-color);
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: -20px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  margin-top: 2rem;
  border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.text-primary {
  color: var(--primary-color) !important;
}

a.text-primary:hover {
  color: var(--primary-hover) !important;
}

.toggle-password {
  background: none;
  border: none;
  padding: 0.75rem;
  cursor: pointer;
  background-color: #f9fafb;
  border-left: 1px solid #d0d5dd;
  position: relative;
}

#toast {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  color: #dc3545;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  padding: 8px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
  text-align: center;
  width: auto;
  min-width: 200px;
  max-width: 85%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  height: 20px;
  background: none;
  box-shadow: none;
  border: none;
}

#toast.show {
  opacity: 1;
}

#toast-message {
  display: inline-block;
  word-wrap: break-word;
  line-height: 1.4;
  font-weight: 500;
  color: #dc3545;
  position: relative;
  padding: 0 4px;
  background: none;
}

#toast-message::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #dc3545, transparent);
  opacity: 0.3;
}

/* Tablet and smaller desktop screens */
@media (max-width: 1024px) {
  #toast {
    font-size: 12px;
    min-width: 180px;
    top: 95px;
    max-width: 80%;
    height: 18px;
  }
}

/* Mobile landscape */
@media (max-width: 768px) {
  #toast {
    font-size: 11px;
    min-width: 160px;
    max-width: 80%;
    top: 90px;
    height: 16px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  #toast {
    font-size: 10px;
    min-width: 140px;
    max-width: 75%;
    top: 85px;
    height: 15px;
  }
}

/* Small height devices */
@media (max-height: 600px) {
  #toast {
    top: 75px;
    height: 14px;
  }
}

/* Ensure toast is always visible on very small screens */
@media (max-width: 320px) {
  #toast {
    font-size: 9px;
    min-width: 120px;
    max-width: 70%;
    top: 80px;
    height: 13px;
  }
}

/* Mobile-specific adjustments */
@media (max-width: 576px) {
  .login-card {
    max-height: 85%;
    width: 92%;
  }
  
  .card-body {
    padding: 1.5rem !important;
  }
}

.form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 2px solid #818386 !important;
  border-radius: 4px;
  background-color: #ffffff !important;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease-in-out;
  vertical-align: middle;
  margin-top: 3px;
}

.form-check-input:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.form-check-input:focus {
  border-color: #0d6efd !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
  outline: none;
}