/* Wilaunch uses the Wichannel Design System v2 foundation. */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("/assets/webfonts/fa-solid-900.woff2") format("woff2"),
       url("/assets/webfonts/fa-solid-900.woff") format("woff");
}

:root {
  --ui-primary: #2f80ed;
  --ui-primary-strong: #1e6ed8;
  --ui-primary-soft: #eaf4ff;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f7f9fc;
  --ui-text: #17324d;
  --ui-text-sub: #607086;
  --ui-border: #d7e3f3;
  --ui-focus: rgba(47, 128, 237, .34);
  --ui-radius-sm: 10px;
  --ui-radius-md: 14px;
  --ui-radius-pill: 999px;
  --launcher-control-height: 46px;
  --launcher-control-radius: var(--ui-radius-md);
  --launcher-form-action-gap: 8px;
  --ui-shadow-subtle: 0 2px 8px rgba(15, 23, 42, .08);
  --ui-duration-fast: 180ms;
  --ui-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --danger: #d83b3b;
  color: var(--ui-text);
  background: #f7f6f9;
  font-family: var(--ui-font-family);
}

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

html,
body { min-width: 320px; min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background: #f7f6f9;
}

button,
input,
textarea { font: inherit; }

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 2px; }

.shell {
  display: flex;
  flex-direction: column;
  width: min(100%, 1080px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 18px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  margin-bottom: clamp(26px, 6vw, 64px);
}

.wordmark {
  display: flex;
  align-items: center;
  min-width: 0;
}

.wordmark-logo {
  display: block;
  width: auto;
  height: 36px;
  max-width: min(190px, 48vw);
  object-fit: contain;
}

.language-toggle,
.text-button {
  border: 0;
  background: transparent;
  color: var(--ui-primary-strong);
  font-size: .84rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .22em;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-pill);
  background: var(--ui-surface);
  color: var(--ui-text);
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: clamp(28px, 7vw, 76px);
  align-items: center;
  animation: launcher-reveal 280ms ease both;
}

.intro { padding: 12px 0; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--ui-primary-strong);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  max-width: 14ch;
  margin-bottom: 18px;
  color: var(--ui-text);
  font-size: clamp(2.25rem, 5vw, 4rem);
  letter-spacing: -.06em;
  line-height: 1.14;
}

.intro-copy {
  max-width: 33rem;
  margin-bottom: 0;
  color: var(--ui-text-sub);
  font-size: 1rem;
  line-height: 1.75;
}

.motif {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 25px 0 0;
  color: var(--ui-text-sub);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .07em;
}

.motif::before { width: 28px; height: 2px; background: var(--ui-primary); content: ""; }

.panel,
.sites-panel,
.profile-panel {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: none;
}

.panel { padding: clamp(24px, 4vw, 36px); }

.panel h2,
.sites-panel h2,
.profile-panel h2 {
  margin-bottom: 8px;
  color: var(--ui-text);
  font-size: 1.45rem;
  letter-spacing: -.04em;
}

.panel-lead,
.sites-panel > p,
.profile-panel > p {
  color: var(--ui-text-sub);
  font-size: .92rem;
  line-height: 1.65;
}

.panel-lead { margin-bottom: 24px; }

.form,
.profile-form { display: grid; gap: 14px; }

.form .notice:empty { display: none; }

/* Launcher form control contract: fields and actions share dimensions. */
.form > .primary-button { margin-top: var(--launcher-form-action-gap); }

.field { display: grid; gap: 7px; }

.field label {
  color: var(--ui-text);
  font-size: .84rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: var(--launcher-control-height);
  padding: 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--launcher-control-radius);
  outline: none;
  color: var(--ui-text);
  background: var(--ui-surface);
  font-size: 1rem;
}

.field textarea { min-height: 82px; resize: vertical; }

.field input:focus,
.field textarea:focus { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-focus); }

.hint {
  margin: -3px 0 0;
  color: var(--ui-text-sub);
  font-size: .78rem;
  line-height: 1.55;
}

.primary-button,
.site-button,
.secondary-button {
  min-height: var(--launcher-control-height);
  border: 1px solid var(--ui-border);
  border-radius: var(--launcher-control-radius);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  transition: background-color var(--ui-duration-fast) ease, border-color var(--ui-duration-fast) ease, color var(--ui-duration-fast) ease;
}

.primary-button,
.site-button {
  color: #fff;
  background: var(--ui-primary);
  border-color: var(--ui-primary);
}

.primary-button:hover,
.site-button:hover { background: var(--ui-primary-strong); border-color: var(--ui-primary-strong); }

.primary-button:disabled,
.site-button:disabled { cursor: wait; opacity: .58; }

.secondary-button {
  padding: 8px 13px;
  color: var(--ui-primary-strong);
  background: var(--ui-surface);
}

.secondary-button:hover { border-color: var(--ui-primary); background: var(--ui-primary-soft); }

.form-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 4px; }

.notice {
  min-height: 1.4em;
  margin: 0;
  color: var(--ui-text-sub);
  font-size: .84rem;
  line-height: 1.6;
}

.notice.error { color: var(--danger); }
.notice.success { color: var(--ui-primary-strong); }

.dashboard { display: grid; gap: 24px; animation: launcher-reveal 280ms ease both; }

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-head h1 { margin: 0; font-size: clamp(2.1rem, 4vw, 3.3rem); }

.account-summary {
  color: var(--ui-text-sub);
  font-size: .88rem;
  line-height: 1.65;
  text-align: right;
}

.account-identity { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 2px; }
.account-role { color: var(--ui-text-sub); font-size: .88rem; font-weight: 600; }
.account-name { color: var(--ui-text); font-size: .88rem; font-weight: 600; }

.account-email { overflow-wrap: anywhere; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr);
  gap: 16px;
}

.sites-panel,
.profile-panel { padding: 24px; }

.site-list { display: grid; gap: 10px; margin-top: 20px; }

.site-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
}

.site-button span { display: grid; gap: 3px; }
.site-button small { color: rgba(255, 255, 255, .78); font-size: .74rem; font-weight: 600; }
.site-button b { font-size: 1rem; font-weight: 600; }

.empty-sites {
  margin: 20px 0 0;
  padding: 16px;
  border: 1px dashed var(--ui-border);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text-sub);
  background: var(--ui-surface-soft);
  font-size: .9rem;
  line-height: 1.65;
}

.profile-form { margin-top: 18px; }
.profile-form .split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.profile-actions .notice { flex: 1; }

.footer {
  margin-top: auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  color: color-mix(in srgb, var(--ui-text-sub) 60%, transparent);
  background: transparent;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

@keyframes launcher-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .shell { padding: 6px 12px 0; }
  .topbar { min-height: 56px; margin-bottom: 24px; }
  .wordmark-logo { height: 30px; }
  .hero,
  .dashboard-grid { grid-template-columns: 1fr; }
  .hero { gap: 14px; }
  .intro { padding: 0; }
  h1 { max-width: 16ch; font-size: clamp(2.2rem, 11vw, 3.4rem); }
  .dashboard-head { align-items: start; flex-direction: column; gap: 8px; }
  .account-summary { align-self: flex-end; text-align: right; }
  .panel,
  .sites-panel,
  .profile-panel { padding: 20px; }
}

@media (max-width: 440px) {
  .profile-form .split { grid-template-columns: 1fr; }
  .profile-actions { align-items: stretch; flex-direction: column; }
}
