/* === Reset & Base === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f4f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

:root {
  --highlightt2: #08801dcc;
  --highlight: #00ed77;
  --green: #008000;
  --text-dark: #333;
  --text-light: #888;
  --error: #e53935;
}

/* === Layout === */
.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  position: relative;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo img {
  max-width: 180px;
}

.logininfo {
  margin-bottom: 20px;
}

.input-icon {
  position: relative;
  margin-bottom: 20px;
}

.input-icon svg {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: #888;
}

.input-icon input {
  width: 100%;
  padding: 12px 12px 12px 36px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 15px;
}

.remember-me {
  font-size: 14px;
  margin-top: -10px;
  margin-bottom: 20px;
}

.btn-primary,
input[type="submit"] {
  width: 100%;
  background-color: var(--green);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary:hover,
input[type="submit"]:hover {
  background-color: var(--highlightt2);
}

.register-btn {
  display: block;
  width: 100%;
  text-align: center;
  background-color: #fff;
  border: 1px solid var(--green);
  color: var(--green);
  padding: 12px;
  border-radius: 6px;
  margin-top: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.register-btn:hover {
  background-color: var(--green);
  color: #fff;
  transition: background-color 0.2s ease;
}

.divider {
  text-align: center;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 14px;
}

.error-message {
  color: var(--error);
  font-size: 14px;
  margin-bottom: 10px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #ccc;
  border-top: 4px solid #1e88e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === Language Switcher === */
.custom-language-switcher {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  cursor: pointer;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-language-switcher img {
  width: 26px;
  height: 18px;
  border-radius: 2px;
  object-fit: cover;
}

.dropdown-arrow {
  font-size: 10px;
  color: #555;
  transition: transform 0.2s ease;
}

.custom-language-switcher.open .dropdown-arrow {
  transform: rotate(180deg);
}

.current-lang-label {
  font-size: 13px;
  color: var(--text-dark);
  display: none;
}

.lang-menu {
  position: absolute;
  top: 30px;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  list-style: none;
  padding: 5px 0;
  margin: 0;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: max-content;
}

.lang-menu.show {
  display: block;
}

.lang-menu li {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.lang-menu li:hover {
  background-color: #f4f4f4;
}

.lang-menu img {
  width: 20px;
  height: 14px;
  object-fit: cover;
}

@media (max-width: 768px) {
  body {
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .login-wrapper {
    height: 100vh;
    width: 100%;
    padding: 0;
  }

  .login-card {
    height: 100%;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .current-lang-label {
    display: inline;
  }

  .login-logo {
    margin-bottom: 20px;
  }
}
