@font-face {
  font-family: Inter;
  src: url("../fonts/Inter-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

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

body {
  font-family: Inter, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px max(16px, env(safe-area-inset-right, 16px))
           20px max(16px, env(safe-area-inset-left, 16px));
  background: linear-gradient(
    135deg,
    #0d0b1e 0%,
    #1a0e3a 15%,
    #0e1e50 30%,
    #2a0a4a 45%,
    #08213f 60%,
    #1e0a40 75%,
    #0a1a3a 90%,
    #0d0b1e 100%
  );
  background-size: 600% 600%;
  animation: gradientShift 12s ease infinite;
  color: #e8e8f4;
}

@keyframes gradientShift {
  0%   { background-position: 0% 0%; }
  25%  { background-position: 100% 30%; }
  50%  { background-position: 60% 100%; }
  75%  { background-position: 10% 60%; }
  100% { background-position: 0% 0%; }
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 40px 36px 36px;
  border-radius: 20px;
  background: rgba(26, 24, 40, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.50);
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #e8e8f4;
  margin-bottom: 28px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a0a0c0;
}

.login-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 15px;
  color: #e8e8f4;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.login-input::placeholder {
  color: rgba(160, 160, 192, 0.45);
}

.login-input:focus {
  border-color: rgba(128, 128, 184, 0.70);
  background: rgba(255, 255, 255, 0.08);
}

.login-password-wrap {
  position: relative;
}

.login-password-wrap .login-input {
  padding-right: 44px;
}

.login-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #a0a0c0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  width: auto;
}

.login-eye-btn:hover {
  color: #e8e8f4;
}

.login-error {
  font-size: 13px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
}

.login-submit {
  margin-top: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: #8080b8;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}

.login-submit:hover {
  background: #9191cc;
}

.login-submit:active {
  transform: scale(0.98);
}

/* ── Theme toggle button ── */
.login-theme-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #a0a0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.login-theme-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #e8e8f4;
}

/* ── Light theme ── */
html[data-theme="light"] body {
  background: linear-gradient(
    135deg,
    #dce8f7 0%,
    #c4d8f5 15%,
    #d8eafd 30%,
    #c0d0f0 45%,
    #ddeeff 60%,
    #c8d8f8 75%,
    #d4e6fa 90%,
    #dce8f7 100%
  );
  background-size: 600% 600%;
  animation: gradientShift 12s ease infinite;
}

html[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.30);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .login-title {
  color: #0f172a;
}

html[data-theme="light"] .login-label {
  color: #475569;
}

html[data-theme="light"] .login-input {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(100, 116, 139, 0.30);
  color: #0f172a;
}

html[data-theme="light"] .login-input::placeholder {
  color: rgba(71, 85, 105, 0.45);
}

html[data-theme="light"] .login-input:focus {
  border-color: rgba(99, 102, 241, 0.55);
  background: #fff;
}

html[data-theme="light"] .login-eye-btn {
  color: #64748b;
}

html[data-theme="light"] .login-eye-btn:hover {
  color: #0f172a;
}

html[data-theme="light"] .login-submit {
  background: #6366f1;
}

html[data-theme="light"] .login-submit:hover {
  background: #4f52e0;
}

html[data-theme="light"] .login-theme-btn {
  border-color: rgba(100, 116, 139, 0.25);
  background: rgba(255, 255, 255, 0.60);
  color: #64748b;
}

html[data-theme="light"] .login-theme-btn:hover {
  background: rgba(255, 255, 255, 0.90);
  color: #0f172a;
}
