/* Change-password UI — formal, modern styling. All UI styling lives here;
   templates carry only class names (no inline styles). */

:root {
  --bg-top: #eef1f6;
  --bg-bottom: #e4e8f1;
  --surface: #ffffff;
  --text: #1e293b;        /* slate-800 */
  --muted: #64748b;       /* slate-500 */
  --border: #e2e8f0;      /* slate-200 */

  --primary: #4f46e5;     /* indigo-600 */
  --primary-dark: #4338ca;/* indigo-700 */
  --ring: rgba(79, 70, 229, 0.28);

  --success: #15803d;
  --danger: #b91c1c;
  --warning: #b45309;
  --info: #2563eb;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow:
    0 1px 3px rgba(15, 23, 42, 0.06),
    0 18px 40px -24px rgba(15, 23, 42, 0.35);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- layout ------------------------------------------------------------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.card__header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.card__title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card__subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.page__footer {
  margin: 1.5rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* --- forms -------------------------------------------------------------- */

.field {
  margin-top: 1.1rem;
}

.field:first-child {
  margin-top: 0;
}

.field__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.field__input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

/* --- buttons & links ---------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.72rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease,
    transform 0.04s ease;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-dark);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

.actions {
  margin: 1.25rem 0 0;
  text-align: center;
}

/* --- messages & notices ------------------------------------------------- */

.message {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.form__error {
  margin: 0.6rem 0 0;
  color: var(--danger);
  font-size: 0.875rem;
}

.notice {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.45;
}

.notice--info {
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  color: #3730a3;
}

.notice--error {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #991b1b;
}

/* --- live status -------------------------------------------------------- */

.status {
  text-align: center;
  padding: 0.5rem 0;
}

.status__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.status__icon {
  margin: 0.5rem 0;
  font-size: 2.5rem;
  line-height: 1;
}

.status__text {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  color: var(--text);
}

.status--pending .status__label {
  color: var(--warning);
}

.status--processing .status__label {
  color: var(--info);
}

.status--done .status__label,
.status--done .status__icon {
  color: var(--success);
}

.status--failed .status__label,
.status--failed .status__icon {
  color: var(--danger);
}

/* --- per-server targets ------------------------------------------------- */

.targets {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.targets__title {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.target {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.target__icon {
  width: 1.1rem;
  text-align: center;
}

.target__name {
  flex: 1;
  color: var(--text);
}

.target__status {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.target--pending .target__status {
  color: var(--warning);
}

.target--processing .target__status {
  color: var(--info);
}

.target--done .target__icon,
.target--done .target__status {
  color: var(--success);
}

.target--failed .target__icon,
.target--failed .target__status {
  color: var(--danger);
}

/* --- spinner ------------------------------------------------------------ */

.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  margin: 0.5rem auto;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--sm {
  width: 1rem;
  height: 1rem;
  margin: 0;
  border-width: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.6s;
  }
}
