/* Ampiang's System installer - one stylesheet, Figtree, Ampiang's colors. */
@import url('../../assets/css/fonts.css');
:root {
  color-scheme: light;
  --bg: #FFF8EE; --card: #fff; --text: #1A1A1A; --muted: #6B5E4E; --border: #EFE4D2; --input: #E5D8C3; --soft: #FFF8EE; --chip: #F3EADB;
  --primary: #E3141B; --primary-hover: #C70F16; --link: #B3121A;
  --ok: #15803d; --ok-bg: #dcfce7; --ok-border: #86efac;
  --bad: #b91c1c; --bad-bg: #fee2e2; --bad-border: #fca5a5;
  --warn: #92400e; --warn-bg: #fef3c7; --warn-border: #fcd34d;
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; font-size: 16px; }
p, li, td, th, label, .note, code, small { overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid #F99B1C; outline-offset: 2px; }
.wrap { max-width: 780px; margin: 0 auto; padding: 24px 16px 48px; }
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; background: #F99B1C; border-radius: 16px; padding: 14px 18px; }
.brand img { width: 150px; display: block; }
.brand span { color: #3A3128 !important; }
.brand .logo { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #2563eb, #22c55e); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.brand strong { font-size: 1.2rem; letter-spacing: .04em; }
.brand span { color: var(--muted); display: block; font-size: .85rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: clamp(18px, 4vw, 28px); box-shadow: 0 1px 3px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.05); min-width: 0; }
h1 { font-size: 1.5rem; margin: 0 0 .6rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
a { color: var(--link); }
code { background: var(--chip); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }
small { display: block; color: var(--muted); font-weight: 400; margin-top: .2rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 18px; }

/* progress */
.progress { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 16px; counter-reset: s; }
.progress li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); position: relative; text-align: center; }
.progress li::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.progress li:first-child::before { display: none; }
.progress .num { width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; z-index: 1; }
.progress li.done .num { background: #16a34a; border-color: #16a34a; color: #fff; }
.progress li.done::before, .progress li.current::before { background: #16a34a; }
.progress li.current .num { border-color: var(--primary); color: var(--primary); }
.progress li.current { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .progress .lbl { display: none; } }

/* forms */
label { display: block; font-weight: 600; margin: 0 0 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  display: block; width: 100%; max-width: 100%; min-height: 44px; margin-top: 4px; padding: 9px 12px; font: inherit; font-size: 16px; font-weight: 400;
  border: 1px solid var(--input); border-radius: 8px; background: var(--card); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; white-space: pre; overflow: auto; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px 2px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: minmax(0, 1fr); } }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--input); background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--chip); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.actions form { margin: 0; }
.actions span { display: flex; gap: 8px; flex-wrap: wrap; }
form.inline { margin: 12px 0; }

/* notes */
.note { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; border: 1px solid var(--border); border-left-width: 4px; background: var(--soft); }
.note ul, .note ol { margin: .4rem 0 0; padding-left: 1.2rem; }
.note.ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.note.bad { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad); }
.note.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }

/* tables */
table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; word-break: break-word; }
.checks th { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.summary th { width: 40%; color: var(--muted); font-weight: 600; }
.fix { margin-top: 4px; font-size: .85rem; color: var(--warn); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.muted { background: var(--chip); color: var(--muted); }

/* strength meter */
.meter { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; font-size: .85rem; color: var(--muted); }
.meter-bar { flex: 0 1 160px; height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* install checklist */
.tasks { list-style: none; padding: 0; margin: 18px 0; }
.tasks li { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.tasks .icon { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); margin-top: 1px; }
.tasks .label { font-weight: 600; }
.tasks .msg { color: var(--muted); font-size: .85rem; }
.tasks li.run .icon { border-color: var(--primary); border-top-color: transparent; animation: spin .8s linear infinite; }
.tasks li.ok .icon { background: #16a34a; border-color: #16a34a; }
.tasks li.ok .icon::after { content: "✓"; color: #fff; font-size: 13px; display: flex; justify-content: center; line-height: 18px; }
.tasks li.bad .icon { background: #b91c1c; border-color: #b91c1c; }
.tasks li.bad .icon::after { content: "!"; color: #fff; font-size: 13px; font-weight: 700; display: flex; justify-content: center; line-height: 18px; }
.tasks li.bad .msg { color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
.manual textarea { margin: 8px 0; }
.next li { margin-bottom: 10px; }
[hidden] { display: none !important; }

.brand-img { max-height: 44px; max-width: 160px; object-fit: contain; }

/* Finish page: printable branch login list */
.logins td, .logins th { padding: 8px 10px; }
.logins code { font-size: 15px; }
@media print {
  .progress, .foot, .actions, form, .note, h2 ~ .next, .next, .btn { display: none !important; }
  .card { box-shadow: none; border: 0; }
}

.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: #fff7ec; border: 1px solid #f3dcc0; padding: 6px; }
