:root {
  --bg-page: #f3f6fb;
  --card-bg: #ffffff;
  --border-color: #e1e7f0;
  --text-main: #1f2933;
  --text-muted: #9aa5b1;
  --primary: #1d64f2;
  --primary-hover: #1554d0;
  --input-border: #cbd2e1;
  --danger: #e12d39;
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo-area {
  margin-bottom: 24px;
}

.logo-area img {
  height: 24px;
}

.card {
  background: var(--card-bg);
  width: 500px;
  padding: 70px 40px 60px;
  border-radius: 2px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.card-title {
  font-size: 25px;
  font-weight: 500;
  margin-bottom: 24px;
}

.login-form {
  text-align: left;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 14px;
}

.field-required {
  color: var(--danger);
  margin-right: 2px;
}

.field-input {
  margin-top: 6px;
  width: 100%;
  height: 35px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid var(--input-border);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(29, 100, 242, 0.25);
}

.forgot-link {
  display: block;
  text-align: center;
  margin: 8px 0 18px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.submit-btn {
  width: 100%;
  height: 35px;
  border-radius: 4px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.submit-btn:hover {
  background: var(--primary-hover);
}

.submit-btn:active {
  transform: translateY(1px);
}

.register-text {
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.field-wrapper {
  margin-bottom: 16px;
}

.field-input.input-error {
  border-color: var(--danger);
}

.error-message {
  display: none;
  color: var(--danger);
  font-size: 11px;
  margin-top: 3px;
  margin-left: 2px;
}

.error-message.show {
  display: block;
}

/* Loading Circular */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#loadingOverlay.show {
  display: flex;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #e1e7f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  background: #28a745;
  color: white;
  font-size: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.modal-title {
  font-size: 22px;
  color: #333;
  margin-bottom: 10px;
}

.modal-text {
  color: #666;
  margin-bottom: 30px;
  font-size: 14px;
}

.modal-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.modal-btn:hover {
  background: var(--primary-hover);
}
