@font-face {
  font-family: "CairoCustom";
  src: url("../../fonts/cairo.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

:root {
  --bg: #f0f6f4;
  --bg-soft: radial-gradient(circle at 5% 5%, #ddf7d6 0, transparent 38%),
    radial-gradient(circle at 95% 90%, #d5efe7 0, transparent 40%);
  --card: #ffffff;
  --text: #103328;
  --muted: #52766b;
  --border: #d9ebe4;
  --accent: #1f8f61;
  --accent-strong: #176b49;
  --accent-soft: #e8f5ef;
  --error-bg: #ffefef;
  --error-text: #912e2e;
  --error-border: #f5c4c4;
  --shadow: 0 18px 45px rgba(9, 52, 38, 0.14);
}

body[data-theme="dark"] {
  --bg: #081712;
  --bg-soft: radial-gradient(circle at 7% 5%, #1f3f33 0, transparent 42%),
    radial-gradient(circle at 92% 95%, #173228 0, transparent 35%);
  --card: #10231c;
  --text: #ecfff7;
  --muted: #9dbcb2;
  --border: #1f3b31;
  --accent: #46bf8a;
  --accent-strong: #2f9f70;
  --accent-soft: #173528;
  --error-bg: #402222;
  --error-text: #ffc7c7;
  --error-border: #6a3636;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "CairoCustom", "Cairo", sans-serif;
  background: var(--bg-soft), var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.login-layout {
  width: min(980px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.hero-panel {
  padding: 42px;
  background: linear-gradient(160deg, #16905f 0%, #0f6041 100%);
  color: #f4fff9;
}

.hero-panel img {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.hero-panel h1 {
  margin: 18px 0 10px;
  font-size: 28px;
  line-height: 1.5;
}

.hero-panel p {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  opacity: 0.95;
}

.hero-points {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.hero-points li {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
}

.login-card {
  padding: 36px 34px;
}

.login-card h2 {
  margin: 0;
  font-size: 28px;
}

.login-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

form {
  margin-top: 24px;
}

.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 7px;
  color: var(--text);
  font-weight: 700;
}

.field-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--accent-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input i {
  color: var(--accent);
  font-size: 15px;
}

.field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 143, 97, 0.12);
}

.field-group input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 14px 0;
  font-family: inherit;
}

.field-group input:focus {
  outline: none;
}

.error-message {
  margin: 10px 0;
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.error-message ul,
.error-message li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.submit-btn {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-strong) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.submit-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.loading_container {
  background: rgba(255, 255, 255, 0.75);
}

body[data-theme="dark"] .loading_container {
  background: rgba(3, 13, 10, 0.7);
}

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

  .hero-panel {
    padding: 26px;
  }

  .hero-panel h1 {
    font-size: 24px;
  }

  .login-card {
    padding: 28px 22px;
  }
}

@media (max-width: 520px) {
  body {
    padding: 14px;
  }

  .theme-toggle {
    top: 10px;
    left: 10px;
    font-size: 13px;
    padding: 8px 12px;
  }

  .hero-panel p {
    font-size: 14px;
  }

  .hero-points li {
    font-size: 14px;
  }
}
