/* Ayrobot ortaq stil. Rənglər loqodan götürülüb (ay = ağ, robot = mavi). */
:root {
  --navy-950: #050b18;
  --navy-900: #08142b;   /* robotun üzü */
  --navy-800: #0e1d3a;
  --navy-700: #16284b;
  --navy-600: #22375f;

  --blue: #299afb;       /* "robot" yazısı */
  --blue-hover: #4aabff;
  --blue-press: #1b82de;
  --cyan: #38c8f0;       /* robotun gözləri */
  --moon: #c3cbe4;       /* ay */

  --bg: var(--navy-950);
  --surface: var(--navy-900);
  --surface-2: var(--navy-800);
  --border: var(--navy-700);
  --text: #eef2fb;
  --muted: #8b97b8;
  --danger: #ff6b7a;
  --success: #3ddc97;

  /* əlavə tokenlər (tema üçün) */
  --text-soft: #c9d2ea;
  --dim: #6a7696;
  --placeholder: #55627f;
  --amber: #f5c842;
  --amber-soft: #ffd98a;
  --hover: rgba(255, 255, 255, .04);
  --hover-2: rgba(255, 255, 255, .06);
  --row-hover: rgba(255, 255, 255, .02);
  --muted-bg: rgba(255, 255, 255, .05);
  --topbar: rgba(5, 11, 24, .85);
  --thead: rgba(5, 11, 24, .5);
  --card-grad: linear-gradient(180deg, rgba(14, 29, 58, .92), rgba(8, 20, 43, .92));
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --backdrop: rgba(2, 6, 16, .65);

  --radius: 12px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

/* Ağ tema: eyni tokenlər açıq rənglərlə */
:root[data-theme="light"] {
  --navy-950: #f3f6fb;
  --navy-900: #ffffff;
  --navy-800: #f1f4f9;
  --navy-700: #dfe5ef;
  --navy-600: #cbd5e4;
  --text: #0e1d3a;
  --muted: #5f6d8c;
  --danger: #d93a4b;
  --success: #12975f;
  --blue-hover: #1b82de;
  --text-soft: #33415f;
  --dim: #8a95ae;
  --placeholder: #9aa5bd;
  --amber: #b7791f;
  --amber-soft: #9a5b00;
  --hover: rgba(8, 20, 43, .04);
  --hover-2: rgba(8, 20, 43, .06);
  --row-hover: rgba(8, 20, 43, .025);
  --muted-bg: rgba(8, 20, 43, .06);
  --topbar: rgba(243, 246, 251, .88);
  --thead: #f6f8fc;
  --card-grad: linear-gradient(180deg, #ffffff, #fbfcfe);
  --shadow: 0 20px 50px rgba(8, 20, 43, .10);
  --backdrop: rgba(8, 20, 43, .35);
  color-scheme: light;
}

/* Loqo: qara fonda ağ yazılı (.on-dark), ağ fonda qara yazılı (.on-light) */
:root:not([data-theme="light"]) .on-light,
:root[data-theme="light"] .on-dark { display: none !important; }

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(41, 154, 251, .14), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(56, 200, 240, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

.card {
  background: var(--card-grad);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.field { margin-top: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--navy-950);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(41, 154, 251, .2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  font: inherit; font-size: 15px; font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--blue-hover); }
.btn:active { background: var(--blue-press); transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.msg { min-height: 20px; margin-top: 14px; font-size: 13px; text-align: center; color: var(--muted); }
.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }

.input[readonly] { background: var(--navy-800); color: var(--muted); cursor: default; }
.input.invalid { border-color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-2 .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.section-title {
  margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--moon);
}

.btn-ghost {
  background: transparent; color: var(--blue); border: 1px solid var(--navy-600);
}
.btn-ghost:hover { background: rgba(41, 154, 251, .1); }
a.btn, a.btn:hover, a.btn:active { color: #fff; }
a.btn-ghost, a.btn-ghost:hover, a.btn-ghost:active { color: var(--blue); }
.btn-ghost:active { background: rgba(41, 154, 251, .18); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-row { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
            font-size: 13px; color: var(--muted); text-align: center; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 36px; height: 36px;
  padding: 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--hover-2); }

.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 7px; transition: color .15s; }
.pw-rules li::before {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--navy-600); background: center / 9px no-repeat;
}
.pw-rules li.bad { color: var(--danger); }
.pw-rules li.bad::before {
  border-color: var(--danger);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2L2 8' stroke='%23ff6b7a' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok::before {
  border-color: var(--success); background-color: rgba(61, 220, 151, .15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.8 5.2l2.2 2.2 4.2-4.6' fill='none' stroke='%233ddc97' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Dialoq pəncərəsi (brauzerin confirm/alert əvəzinə) */
.dlg-backdrop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: var(--backdrop); backdrop-filter: blur(3px); opacity: 0; transition: opacity .15s;
}
.dlg-backdrop.show { opacity: 1; }
.dlg {
  width: 100%; max-width: 420px; padding: 24px 24px 20px; border-radius: 16px; text-align: center;
  background: var(--navy-900); border: 1px solid var(--navy-600); box-shadow: var(--shadow);
  transform: translateY(8px) scale(.98); transition: transform .15s;
}
.dlg-backdrop.show .dlg { transform: none; }
.dlg-icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px;
  color: var(--blue); background: rgba(41, 154, 251, .12);
}
.dlg-icon.danger { color: var(--danger); background: rgba(255, 107, 122, .12); }
.dlg-icon svg { width: 26px; height: 26px; }
.dlg h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.dlg p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.dlg dl {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; padding: 12px 14px;
  border-radius: 10px; background: var(--navy-950); border: 1px solid var(--border); text-align: left; font-size: 13.5px;
}
.dlg dt { color: var(--muted); }
.dlg dd { margin: 0; font-weight: 600; }
.dlg-actions { display: flex; gap: 10px; margin-top: 20px; }
.dlg-actions .btn { flex: 1; }
.btn-danger { background: #d9434f; }
.btn-danger:hover { background: #e55661; }
.btn-danger:active { background: #c23641; }
