:root {
  --primary: #D30000;
  --primary-hover: #B80000;
  --bg: #FFFFFF;
  --surface: #FAFAFA;
  --text-primary: #1A1A1A;
  --text-secondary: #4D4D4D;
  --border: #E5E7EB;
  --error: #D30000;
  --overlay: rgba(26, 26, 26, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  
  background-color: #FFFFFF;
  background-image: 
    radial-gradient(#ED1C24 0.5px, transparent 0.5px),
    radial-gradient(#045CB4 0.5px, #FFFFFF 0.5px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;

  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 12px;
  line-height: 1.4;
  
}

.login-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.logo {
  margin-bottom: 8px; 
  height: 30px;
  width: auto;
}

h2 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.input-group {
  margin-bottom: 12px; 
  text-align: left;
}

.input-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px; 
}

.input-group input {
  width: 100%;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  transition: border 0.2s;
}

.input-group input:focus {
  border: 2px solid var(--primary);
  outline: none;
}

.password-toggle {
  margin-left: 8px;
  cursor: pointer;
  user-select: none;
}

button {
  width: 100%;
  height: 32px;
  background: #242735;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover {
  
  background: #25d366;
}

button:active {
  transform: scale(0.98);
}

a {
  color: #242735;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
  margin-top: 15px;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

.error-message {
  color: var(--error);
  font-size: 12px;
  margin-top: 8px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--surface);
  padding: 24px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.modal-content h2 {
  margin-bottom: 12px;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 14px;
}

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: var(--primary);
}

.spinner {
  display: none;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 480px) {
  .login-container {
    padding: 16px;
  }
  
  .modal-content {
    padding: 16px;
  }
}

.pin-wrapper {
  position: relative;
  width: 100%;
}

#pin {
  width: 100%;
  padding-right: 36px; 
  height: 32px;
}

.toggle-pin {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-pin:hover {
  background: rgba(153, 223, 86, 0.1);
}

.toggle-pin img {
  width: 16px;
  height: 16px;
  transition: all 0.2s;
}

.login-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 12px 0;
}

.login-footer p {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

.login-footer a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.login-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/*============= CSS Lock =============*/

#screen-blocker {
  display: none;
}

@media (max-width: 768px) {
  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden !important;
  }

  #screen-blocker {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999; 
    background: #f9f9f9;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    flex-direction: column;
  }

  .screen-blocker-message h2 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #1ebe5d;
  }

  .screen-blocker-message p {
    font-size: 14px;
    color: grey;
  }

  *:not(#screen-blocker):not(#screen-blocker *) {
    pointer-events: none;
    user-select: none;
  }
}

