:root {
  --bg: #071209;
  --card: rgba(18, 28, 22, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ecfdf5;
  --muted: #86efac;
  --muted-dim: #6b9080;
  --primary: #40916c;
  --primary-hover: #2d6a4f;
  --accent: #95d5b2;
  --danger: #f87171;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(64, 145, 108, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(45, 106, 79, 0.2), transparent),
    linear-gradient(165deg, #071209 0%, #0d1f14 45%, #071209 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: float 18s ease-in-out infinite;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: #2d6a4f;
  top: -80px;
  inset-inline-start: -60px;
}

.orb-b {
  width: 280px;
  height: 280px;
  background: #1b4332;
  bottom: 10%;
  inset-inline-end: -40px;
  animation-delay: -6s;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -16px) scale(1.05); }
}

.login-page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
}

.login-showcase {
  padding: 24px 16px;
}

.showcase-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(64, 145, 108, 0.15);
  border: 1px solid rgba(149, 213, 178, 0.25);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 20px;
}

.login-showcase h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #d8f3dc, #95d5b2 50%, #40916c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted-dim);
  max-width: 420px;
}

.features {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: #b7e4c7;
}

.features li span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  font-size: 1.1rem;
}

.note {
  font-size: 0.88rem;
  color: var(--accent);
  padding: 12px 16px;
  background: rgba(64, 145, 108, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(64, 145, 108, 0.2);
  max-width: 400px;
}

.login-card-wrap {
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.logo-mark {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #2d6a4f, #40916c);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(64, 145, 108, 0.35);
}

.login-card-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.login-card-head p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted-dim);
}

.login-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  margin-bottom: 16px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fecaca;
}

.login-alert.hidden { display: none; }
.login-alert.ok {
  background: rgba(64, 145, 108, 0.15);
  border-color: rgba(64, 145, 108, 0.35);
  color: #b7e4c7;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #1f2937;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.gis-mount {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  min-height: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted-dim);
  font-size: 0.78rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-form label {
  display: block;
  margin-bottom: 14px;
}

.login-form label > span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted-dim);
  margin-bottom: 6px;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.15s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.2);
}

.pw-wrap {
  position: relative;
}

.pw-wrap input { padding-inline-end: 44px; }

.pw-toggle {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  padding: 4px 8px;
}

.form-links {
  text-align: end;
  margin: -6px 0 16px;
}

.form-links a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}

.form-links a:hover { text-decoration: underline; }

.btn-primary {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #40916c, #2d6a4f);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, opacity 0.15s;
  box-shadow: 0 8px 28px rgba(64, 145, 108, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-spinner.hidden { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted-dim);
}

.login-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover { text-decoration: underline; }

.login-footer .tiny {
  margin-top: 12px;
  font-size: 0.75rem;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }

  .login-showcase {
    text-align: center;
    padding-bottom: 0;
  }

  .lead, .note, .features { margin-inline: auto; }
  .features { max-width: 320px; }
  .note { margin-inline: auto; }
}

@media (max-width: 480px) {
  .login-card { padding: 24px 20px; }
  .login-showcase h1 { font-size: 1.75rem; }
}
