/* ===========================
   Google Font Import
   =========================== */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

/* ===========================
   CSS Variables (Theme)
   =========================== */
:root {
  --bg: #f7f9fb;
  --bg-grad-a: #ffffff;
  --bg-grad-b: #f5f7fa;
  --text: #0f172a;
  --muted: #475569;
  --border: #e5e7eb;
  --accent: #333333;
  --accent-2: #10b981;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 180ms ease;
}

/* ===========================
   Persian Font (Shabnam)
   =========================== */
@font-face {
  font-family: shabnam;
  src: url("../font/Shabnam.woff2") format("woff2"),
       url("../font/Shabnam.woff") format("woff"),
       url("../font/Shabnam.eot") format("eot"),
       url("../font/IranNastaliq.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ===========================
   CSS Reset & Base
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: linear-gradient(
    180deg,
    var(--bg-grad-a),
    var(--bg-grad-b)
  );
  color: var(--text);
  font-family: shabnam, "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Layout Container
   =========================== */
.container {
  max-width: 960px;
  margin-inline: auto;
  padding: 16px;
}

/* ===========================
   Header
   =========================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 20px;
}

.brand .title {
  font-weight: 100;
  letter-spacing: 0.2px;
}

/* ===========================
   Language Switch
   =========================== */
.lang-switch {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}

.lang-btn:hover {
  background: #f1f5f9;
}

.lang-btn.active {
  background: #e8eefc;
  color: var(--accent);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 20px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 600;
}

.subtitle {
  margin: 0 auto;
  color: var(--muted);
  max-width: 60ch;
}

/* ===========================
   Card & Form
   =========================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.form-card {
  padding: 20px;
}

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

.form-row {
  display: grid;
  gap: 8px;
}

label {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ===========================
   Inputs & Textarea
   =========================== */
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:hover,
textarea:hover {
  background: #fbfdff;
}

input:focus,
textarea:focus {
  border-color: color-mix(
    in oklab,
    var(--accent) 60%,
    var(--accent-2)
  );
  box-shadow: 0 0 0 6px
    color-mix(
      in oklab,
      var(--accent) 15%,
      white
    );
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===========================
   Actions & Button
   =========================== */
.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.primary-btn {
  border: none;
  color: #fff;
  background: var(--accent);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 100;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.2);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.primary-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  margin-top: 32px;
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===========================
   Toast Notification
   =========================== */
.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 20px;
  margin-inline: auto;
  width: min(92%, 560px);
  background: #0ea5e9;
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 20px 36px rgba(2, 132, 199, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 240ms ease, transform 240ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ===========================
   Fade Animations
   =========================== */
.fade-swap {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.fade-swap.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   Loading Overlay
   =========================== */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* ===========================
   Loader Animation
   =========================== */
.loader {
  width: 60px;
  aspect-ratio: 1;
  --c: no-repeat linear-gradient(135deg, #fff, #fff);
  background:
    var(--c) 0 0,
    var(--c) 50% 50%,
    var(--c) 100% 100%;
  animation:
    loader-anim 1s infinite alternate,
    pulse 2s infinite ease-in-out;
  border-radius: 8px;
  box-shadow: 0 0 10px #333, 0 0 20px #fff;
}

@keyframes loader-anim {
  0%,
  10% {
    background-size: 20% 100%;
  }
  50% {
    background-size: 20% 20%;
  }
  90%,
  100% {
    background-size: 100% 20%;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

/* ===========================
   Direction & Language
   =========================== */
html[dir="ltr"] label {
  text-align: left;
}

html[dir="rtl"] label {
  text-align: right;
}

html[lang="en"] body {
  font-family: "Inter", system-ui, -apple-system,
    Segoe UI, Roboto, Arial, sans-serif;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 720px) {
  .form-card {
    padding: 16px;
  }

  .actions {
    justify-content: stretch;
  }

  .primary-btn {
    width: 100%;
  }
}

/* ===========================
   Text Selection
   =========================== */
::selection {
  background: #999;
  color: #000;
}

::-moz-selection {
  background: #999;
  color: #000;
}