:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f6fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 5vw, 72px);
  color: white;
  background: linear-gradient(125deg, #111b35, #174a72);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.6rem, 3vw, 2.35rem); }
h2 { margin-bottom: 18px; }
.eyebrow { margin-bottom: 5px; color: #70d6ff; font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

main { width: min(1120px, calc(100% - 32px)); margin: 32px auto 72px; }
.card { margin-bottom: 24px; padding: clamp(20px, 3vw, 32px); border: 1px solid #dce4ef; border-radius: 18px; background: white; box-shadow: 0 18px 45px rgba(28, 47, 78, .08); }
.narrow { width: min(560px, 100%); margin-inline: auto; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

form { display: grid; gap: 16px; }
.form-grid { grid-template-columns: minmax(180px, 1.5fr) minmax(150px, .7fr) minmax(220px, 1fr) auto; align-items: end; }
label { display: grid; gap: 7px; color: #38445b; font-size: .86rem; font-weight: 750; }
input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #bcc8d9; border-radius: 9px; color: #172033; background: white; }
input:focus { outline: 3px solid rgba(22, 119, 176, .18); border-color: #1677b0; }

button { min-height: 44px; padding: 10px 17px; border: 0; border-radius: 9px; color: white; background: #176ea5; font-weight: 800; }
button:hover { background: #125b8a; }
button:disabled { cursor: not-allowed; opacity: .55; }
button.secondary { border: 1px solid #b8c6d9; color: #27344c; background: #f7f9fc; }
button.secondary:hover { background: #eaf0f7; }
button.danger { background: #a92f42; }
button.danger:hover { background: #8d2335; }

.notice { min-height: 24px; margin: 0 0 14px; color: #34445e; font-weight: 700; }
.notice.error { color: #a12035; }
.secret-result { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 22px; padding: 16px; border: 1px solid #8bd2ae; border-radius: 12px; background: #effbf5; }
.secret-result strong { grid-column: 1 / -1; }
.secret-result code { overflow-wrap: anywhere; color: #143527; font-size: .95rem; }

.license-list { display: grid; gap: 14px; }
.license-empty { padding: 24px; border: 1px dashed #bdc9d8; border-radius: 12px; text-align: center; color: #66748a; }
.license { padding: 18px; border: 1px solid #d9e1eb; border-radius: 14px; background: #fbfcfe; }
.license-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.license-title { margin-bottom: 4px; }
.license-meta { margin-bottom: 0; color: #657188; font-size: .85rem; }
.badge { padding: 5px 9px; border-radius: 999px; color: #17633c; background: #e5f7ec; font-size: .75rem; font-weight: 850; text-transform: uppercase; }
.badge.revoked { color: #8f2638; background: #fbe7eb; }
.license-controls { display: grid; grid-template-columns: 150px minmax(220px, 1fr) auto auto auto; gap: 10px; align-items: end; margin-top: 16px; }
.installations { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #dce4ee; }
.installation { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 9px; background: #eef3f8; }
.installation code { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .form-grid, .license-controls { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .site-header, .section-heading, .license-head, .installation { align-items: stretch; flex-direction: column; }
  .form-grid, .license-controls, .secret-result { grid-template-columns: 1fr; }
}
