:root {
  --ink: #001225;
  --ink-soft: rgba(0, 18, 37, 0.08);
}

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

body {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login {
  width: min(420px, 100%);
}

.login-card {
  border: 1px solid rgba(0, 18, 37, 0.18);
  border-radius: 20px;
  padding: 32px;
  display: grid;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 18, 37, 0.1);
}

.login.is-blurred {
  filter: blur(6px);
  transition: filter 0.2s ease;
}

.logo {
  width: 220px;
  margin: 0 auto;
}

h1 {
  font-family: "Spectral", "Georgia", serif;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: rgba(0, 18, 37, 0.7);
}

form {
  display: grid;
  gap: 18px;
}

.section {
  display: grid;
  gap: 12px;
}

.section-title {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 18, 37, 0.55);
  margin-top: 2px;
}

.form-error {
  min-height: 22px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(180, 0, 0, 0.08);
  color: #7a0000;
  font-size: 0.9rem;
  display: none;
}

.form-error.visible {
  display: block;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  min-width: 0;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  padding-right: 86px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(0, 18, 37, 0.08);
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
}

.toggle-password:hover {
  background: rgba(0, 18, 37, 0.16);
  transform: translateY(-50%) scale(1.02);
}

.eye-icon {
  width: 16px;
  height: 16px;
}

.eye-icon svg {
  width: 100%;
  height: 100%;
}

.toggle-password .eye-closed {
  display: none;
}

.toggle-password.is-visible .eye-open {
  display: none;
}

.toggle-password.is-visible .eye-closed {
  display: inline-flex;
}

input {
  border: 1px solid rgba(0, 18, 37, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

input:focus {
  border-color: rgba(0, 18, 37, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 18, 37, 0.12);
  outline: none;
}

.primary {
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 18, 37, 0.2);
}

.helper,
.note {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(0, 18, 37, 0.6);
}

.helper-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.helper a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.helper a:hover {
  border-bottom-color: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 18, 37, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  width: min(580px, 100%);
  display: grid;
  gap: 20px;
  position: relative;
  max-height: min(85vh, 720px);
  overflow: auto;
  animation: rise-in 0.28s ease;
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
}

.grid {
  display: grid;
  gap: 18px 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-identity label:nth-child(3) {
  grid-column: span 2;
}

.grid-address label:first-child {
  grid-column: span 2;
}

.photo-block {
  display: grid;
  grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px dashed rgba(0, 18, 37, 0.2);
  border-radius: 16px;
}

.photo-preview {
  width: 110px;
  height: 110px;
  border-radius: 18px;
  background: var(--ink-soft);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: rgba(0, 18, 37, 0.6);
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-actions {
  display: grid;
  gap: 8px;
}

.photo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 18, 37, 0.3);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.photo-button:hover {
  background: var(--ink);
  color: #fff;
  transform: translateY(-2px);
}

#photo-input {
  display: none;
}

.hint {
  font-size: 0.8rem;
  color: rgba(0, 18, 37, 0.6);
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-card {
  border: 1px solid rgba(0, 18, 37, 0.16);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.user-card span {
  font-size: 0.9rem;
  color: rgba(0, 18, 37, 0.75);
}

.delete-btn {
  border: none;
  background: rgba(180, 0, 0, 0.08);
  color: #7a0000;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.delete-btn:hover {
  background: rgba(180, 0, 0, 0.16);
  transform: translateY(-1px);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .login-card {
    padding: 24px;
  }

  .modal-content {
    padding: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .grid-identity label:nth-child(3) {
    grid-column: auto;
  }

  .grid-address label:first-child {
    grid-column: auto;
  }

  .photo-block {
    grid-template-columns: 1fr;
  }

  .photo-preview {
    justify-self: center;
  }
}
