:root {
  --bg-1: #3a4f6e;
  --bg-2: #0f1316;
  --surface: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  --surface-strong: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --text: #e9f6ff;
  --text-soft: rgba(220, 230, 240, 0.72);
  --text-muted: rgba(220, 230, 240, 0.52);
  --accent: #6ba3ff;
  --accent-strong: #8ec6ff;
  --accent-soft: rgba(107, 163, 255, 0.16);
  --danger: #ff7b93;
  --danger-soft: rgba(255, 123, 147, 0.16);
  --success: #5fe0a1;
  --success-soft: rgba(95, 224, 161, 0.16);
  --input-bg: rgba(8, 12, 18, 0.34);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-border-focus: rgba(107, 163, 255, 0.65);
}

html {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  color: var(--text);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.25s ease;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: #f8fbff;
  transition: 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

input:checked + .slider {
  background: linear-gradient(135deg, rgba(90, 170, 255, 0.92), rgba(130, 196, 255, 0.88));
  border-color: rgba(140, 205, 255, 0.5);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.view-toggle .slider {
  background: rgba(255, 255, 255, 0.12);
}

.view-toggle-container {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.view-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-soft);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.view-icon svg {
  display: block;
}

.view-icon:hover,
.view-icon:focus-visible {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  outline: none;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 160px);
  padding: 2rem 1rem;
}

.login-form {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem;
  border-radius: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.login-form h2 {
  margin-bottom: 1.75rem;
  text-align: center;
  font-size: 1.9rem;
  font-weight: 600;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.35;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-form input:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(107, 163, 255, 0.15);
  background: rgba(8, 12, 18, 0.48);
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.login-form .btn-primary {
  width: 100%;
  padding: 0.95rem 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(107, 163, 255, 0.35);
  color: #eef8ff;
  background: linear-gradient(180deg, rgba(90, 170, 255, 0.28), rgba(90, 170, 255, 0.16));
  box-shadow: 0 10px 24px rgba(35, 74, 120, 0.32);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-form .btn-primary:hover,
.login-form .btn-primary:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(90, 170, 255, 0.36), rgba(90, 170, 255, 0.2));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  outline: none;
}

.flash-message {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-soft);
}

.login-form .flash-message {
  background: rgba(255, 123, 147, 0.12);
  border-color: rgba(255, 123, 147, 0.24);
  color: #ffd5dc;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .view-toggle {
    display: inline-block;
    width: 42px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .login-form {
    padding: 1.6rem 1.25rem;
    border-radius: 18px;
  }

  .login-form h2 {
    font-size: 1.55rem;
  }
}
