/* Minimal, clean, responsive login (single CSS file) */
* {
  box-sizing: border-box;
}

:root {
  --bg1: #c7d2fe;
  --bg2: #e9d5ff;
  --bg3: #f3e8ff;

  --text: #111827;
  --muted: #6b7280;

  --primary: #4f46e5;
  --primary2: #4338ca;

  --border: #d1d5db;
  --ring: rgba(99, 102, 241, .35);

  --radius: 18px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color: var(--text);
  background: linear-gradient(to bottom right, var(--bg1), var(--bg2), var(--bg3));
  overflow-x: hidden;
}

.page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  /* فاصله موبایل از لبه‌ها */
}

.card {
  width: min(420px, calc(100vw - 36px));
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .15);
  animation: fadeIn .6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo: همیشه نصف عرض ورودی‌ها */
.logoBox {
  width: 50%;
  margin: 6px auto 22px;
}

.logoBox img {
  width: 100%;
  height: auto;
  display: block;
}

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

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
}

.field input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px var(--ring);
}

.btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  transition: transform .08s ease, filter .15s ease;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn:active {
  transform: scale(0.99);
}

.msg {
  margin: 2px 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  min-height: 18px;
  /* صفحه نلرزه وقتی ارور میاد/می‌ره */
}

.msg.error {
  color: #ef4444;
}

@media (max-width: 480px) {
  .page {
    align-items: flex-start;
    padding-top: 48px;
    /* کارت میاد بالاتر */
  }
}