:root {
  color-scheme: light;
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: #15233e;
  background: #f4f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #15233e;
  --muted: #52627a;
  --line: #dce4ef;
  --blue: #145bd7;
  --blue-dark: #104bb5;
  --cyan: #25bad3;
  --surface: #fff;
  --error: #bd3441;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(45, 120, 211, 0.08), transparent 48%),
    linear-gradient(150deg, #f8faff 0%, #f1f5fa 100%);
}

button, input { font: inherit; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-content: center;
  padding: 48px 20px 24px;
}

.generator-card {
  width: min(100%, 760px);
  padding: 34px 40px 30px;
  border: 1px solid #e0e7f1;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: var(--ink);
}

.brand-mark { width: 34px; height: 34px; color: var(--blue); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -0.04em; }

.divider {
  height: 1px;
  margin: 23px 0 28px;
  background: var(--line);
}

.heading-block { margin-bottom: 28px; text-align: center; }
.heading-block h1 { margin: 0; color: var(--ink); font-size: 31px; line-height: 1.5; font-weight: 800; letter-spacing: -0.045em; }
.heading-block p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.prototype-note {
  margin: -12px 0 22px;
  padding: 9px 12px;
  border: 1px solid #d8e3ef;
  border-radius: 9px;
  background: #f6f8fb;
  color: #53647b;
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 176px;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.field-row label {
  color: #273752;
  font-size: 15px;
  font-weight: 700;
}

.field-row label span { display: inline-block; unicode-bidi: isolate; }

.field-row input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid #7d8ca3;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #18243a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: 0.025em;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  unicode-bidi: isolate;
}

.field-row input::placeholder { color: var(--muted); font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14px; letter-spacing: 0; }
.field-row input:hover { border-color: #8ea0ba; }
.field-row input:focus { border-color: var(--blue); outline: 3px solid #d6e4f7; outline-offset: 1px; box-shadow: none; }

.form-error {
  min-height: 23px;
  margin: -5px 0 10px;
  color: var(--error);
  font-size: 13px;
  line-height: 1.7;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(100deg, #1765e7, #1058ce);
  color: white;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover { background: linear-gradient(100deg, #115bd7, #0d4db8); box-shadow: 0 7px 18px rgba(0, 0, 0, 0.16); }
.primary-button:active { transform: translateY(1px); }
.primary-button:focus-visible, .copy-button:focus-visible { outline: 3px solid #1265c9; outline-offset: 3px; }
.primary-button:disabled { cursor: wait; background: #1058ce; opacity: 1; }

.button-spinner {
  width: 17px;
  height: 17px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.is-loading .button-spinner { display: inline-block; }

.result-panel {
  margin-top: 24px;
  padding: 17px 18px 18px;
  border: 1px solid #5b93a6;
  border-radius: 13px;
  background: linear-gradient(115deg, #f2fcff 0%, #e8f7fb 100%);
}

.result-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.result-heading h2 { margin: 0; color: #20334f; font-size: 15px; font-weight: 700; line-height: 1.5; }
.result-heading h2 span { display: inline-block; unicode-bidi: isolate; }
.result-dot { width: 8px; height: 8px; border-radius: 50%; background: #0086a5; }

.result-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; direction: rtl; }

.password-output {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid #8098a8;
  border-radius: 10px;
  background: #fff;
  color: #15233e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.22em;
  unicode-bidi: isolate;
}

.password-output:empty::before { content: '— — — — — —'; color: var(--muted); letter-spacing: 0.13em; }

.copy-button {
  min-width: 112px;
  min-height: 56px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: #087c99;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background 160ms ease, opacity 160ms ease;
}

.copy-button:hover:not(:disabled) { background: #066b84; }
.copy-button:disabled { background: #5d7481; cursor: not-allowed; opacity: 1; }
.copy-button svg { width: 19px; height: 19px; }

.status-message { min-height: 22px; margin: 10px 2px -5px; color: #477183; font-size: 12px; line-height: 1.6; }
.page-footer { margin-top: 18px; color: var(--muted); font-size: 12px; text-align: center; }

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

@media (max-width: 620px) {
  .page-shell { place-content: start center; padding: 20px 14px 18px; }
  .generator-card { padding: 25px 20px 22px; border-radius: 18px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 19px; }
  .divider { margin: 19px 0 23px; }
  .heading-block { margin-bottom: 23px; }
  .heading-block h1 { font-size: 26px; }
  .heading-block p { font-size: 13px; }
  .prototype-note { margin: -8px 0 18px; padding: 8px 10px; }
  .field-row { grid-template-columns: 1fr; gap: 7px; margin-bottom: 15px; }
  .field-row label { font-size: 14px; }
  .field-row input { height: 53px; }
  .form-error { margin-top: -2px; }
  .primary-button { min-height: 54px; }
  .result-panel { margin-top: 19px; padding: 15px 13px; }
  .result-row { grid-template-columns: 1fr auto; gap: 8px; }
  .password-output { min-height: 52px; padding: 0 12px; font-size: 19px; letter-spacing: 0.14em; }
  .copy-button { min-width: 88px; min-height: 52px; padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
