*,
*::before,
*::after { box-sizing: border-box; font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; }

:root {
  --color-brand: #6f2da8;
  --color-brand-hover: #54207f;
  --color-brand-light: #8f4fd0;
  --color-canvas: #fbfaf7;
  --color-surface: rgba(255, 255, 255, 0.96);
  --color-border: #d8dde8;
  --color-border-strong: #aeb6c2;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --transition-fast: 100ms ease;
  --transition-base: 180ms ease;
}

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(111, 45, 168, 0.1), transparent 24rem),
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.12), transparent 18rem),
    linear-gradient(180deg, #fffdfa 0%, var(--color-canvas) 30%, #f3f5fb 100%);
}

a { text-decoration: none; color: inherit; }

nav {
  display: flex;
  align-items: center;
  padding: 18px 32px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  backdrop-filter: blur(14px);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(111, 45, 168, 0.16);
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: auto;
  padding: 56px 20px;
}

.card {
  width: 100%;
  max-width: 440px;
  margin: auto;
  background: var(--color-surface);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

h1 {
  font-size: 28px;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0;
  color: #1a1a2e;
}

p.description {
  text-align: center;
  font-size: 14px;
  color: #555;
  margin-bottom: 22px;
  line-height: 1.6;
}

form .form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 600;
  color: #1f2937;
}

.password-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 4px rgba(124,34,212,0.1);
}

input.error {
  border-color: #dc2626;
}

input.error:focus {
  box-shadow: 0 0 0 4px rgba(220,38,38,0.1);
}

.error-msg {
  display: block;
  min-height: 16px;
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

.btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand-light));
  color: white !important;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(111, 45, 168, 0.16);
  transition: transform var(--transition-fast), filter var(--transition-base), box-shadow var(--transition-base);
}

button.btn { color: white !important; }

.btn:hover,
button.btn:hover,
button[type="submit"]:hover,
form .btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  color: white !important;
  border-color: var(--color-brand) !important;
}

.btn:focus,
.btn:active,
button.btn:focus,
button.btn:active,
button[type="submit"]:focus,
button[type="submit"]:active {
  color: white !important;
  border-color: var(--color-brand) !important;
  box-shadow: 0 0 0 0 rgba(0,0,0,0) !important;
}

.text-center { text-align: center; }

.text-primary {
  color: var(--color-brand);
  font-weight: 600;
}

.text-primary:hover { text-decoration: underline; }

.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #dcfce7;
  color: #166534;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}

.alert-icon {
  flex-shrink: 0;
  font-size: 16px;
}

.forgot-link {
  font-size: 13px;
  color: var(--color-brand);
  font-weight: 500;
}

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

.register-link {
  font-size: 13px;
  margin-top: 16px;
  line-height: 1.5;
  color: #6b7280;
}

.modal-header, .modal-footer { border: none; }
.modal-title { color: var(--color-brand); font-weight: 700; }
.btn-close { filter: invert(27%) sepia(90%) saturate(6346%) hue-rotate(268deg) brightness(97%) contrast(97%); }

@media (max-width: 520px) {
  nav {
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .nav-logo {
    gap: 8px;
    font-size: 1rem;
  }

  .container {
    padding: 32px 16px 48px;
  }

  .card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  h1 { font-size: 1.7rem; }

  .password-label { align-items: flex-start; }

  .forgot-link { font-size: 12px; }

  .alert {
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  nav { padding-inline: 12px; }
  .container { padding-inline: 12px; }
  .card { padding: 20px 16px; }
}
