@import url("../app-shell.css");

:root {
  color-scheme: dark;
  --guild-page: #090909;
  --guild-panel: #181818;
  --guild-panel-soft: #121212;
  --guild-line: #2b2b2b;
  --guild-line-strong: #424242;
  --guild-text: #f4f4f4;
  --guild-muted: #858585;
  --guild-green: #67d28d;
  --guild-cyan: #5ccbd0;
  --guild-gold: #c7a85b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: #000; }
body {
  color: var(--guild-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.guild-phone {
  background:
    radial-gradient(300px 190px at 5% -2%, rgba(78, 94, 128, .28), transparent 68%),
    var(--guild-page);
}
.guild-app { height: 100%; display: flex; flex-direction: column; }
.status {
  min-height: 35px;
  padding: 11px 20px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 650;
}
.status-r { display: flex; align-items: center; gap: 5px; }
.status-r svg { display: block; }
.detail-header {
  position: relative;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-header h1 { font-size: 16px; font-weight: 680; }
.back-link {
  position: absolute;
  left: 7px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #ececec;
  text-decoration: none;
}
.back-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 12px 16px 30px;
}
.page-scroll::-webkit-scrollbar { display: none; }

.guild-identity { display: grid; justify-items: center; padding: 5px 0 22px; text-align: center; }
.detail-avatar {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #363636;
  border-radius: 24px;
  background: linear-gradient(145deg, #293144, #161922);
  color: #eef0f5;
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -.5px;
}
.detail-avatar img { width: 58px; height: 58px; object-fit: contain; }
.detail-avatar.warm { background: linear-gradient(145deg, #65503f, #332a23); }
.detail-avatar.green { background: linear-gradient(145deg, #3d6054, #22372f); }
.detail-avatar.violet { background: linear-gradient(145deg, #55496b, #2b2635); }
.detail-avatar.blue { background: linear-gradient(145deg, #385d70, #1f333e); }
.guild-identity h2 { margin-top: 13px; font-size: 20px; line-height: 1.25; font-weight: 720; }
.country { margin-top: 6px; color: #929292; font-size: 12px; }

.metric-card {
  padding: 17px 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  border: 1px solid var(--guild-line-strong);
  border-radius: 19px;
  background: rgba(18, 18, 18, .88);
}
.metric { text-align: center; }
.metric + .metric { border-left: 1px solid #292929; }
.metric span { display: block; color: #747474; font-size: 10px; }
.metric strong { display: block; margin-top: 7px; font-size: 14px; font-weight: 680; }
.metric.success strong { color: var(--guild-green); }
.metric.fulfil strong { color: var(--guild-cyan); }
.metric.complaint strong { color: var(--guild-gold); }

.detail-section { margin-top: 28px; }
.detail-section h2 { margin: 0 3px 11px; font-size: 15px; font-weight: 680; }
.leader-list {
  padding: 4px 14px;
  border: 1px solid var(--guild-line);
  border-radius: 16px;
  background: var(--guild-panel);
}
.leader-row { min-height: 62px; display: flex; align-items: center; gap: 11px; }
.leader-row + .leader-row { border-top: 1px solid #292929; }
.leader-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #3e4657, #242833);
  color: #e8e8e8;
  font-size: 11px;
  font-weight: 720;
}
.leader-copy { min-width: 0; flex: 1; }
.leader-copy strong { display: block; font-size: 13px; font-weight: 650; }
.leader-copy span { display: block; margin-top: 4px; color: #797979; font-size: 10px; }
.leader-role { padding: 3px 7px; border: 1px solid #4a4330; border-radius: 6px; color: #cdb978; font-size: 9px; }
.leader-role.vice { border-color: #3f3f3f; color: #aaa; }

.copy-card {
  padding: 16px;
  border: 1px solid var(--guild-line);
  border-radius: 16px;
  background: var(--guild-panel);
}
.copy-card p { color: #b1b1b1; font-size: 12px; line-height: 1.75; }

.content-hero { padding: 7px 4px 4px; }
.content-hero h2 { font-size: 25px; line-height: 1.25; letter-spacing: -.5px; }
.content-hero p { margin-top: 12px; color: #929292; font-size: 12px; line-height: 1.75; }
.content-section { margin-top: 30px; }
.content-section > h2 { margin: 0 3px 12px; font-size: 17px; font-weight: 700; }
.reason-list { display: grid; gap: 9px; }
.reason-card {
  min-height: 76px;
  padding: 14px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--guild-line);
  border-radius: 15px;
  background: var(--guild-panel);
}
.reason-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #ededeb;
  color: #151515;
  font-size: 13px;
  font-weight: 760;
}
.reason-copy strong { display: block; font-size: 13px; font-weight: 680; }
.reason-copy p { margin-top: 5px; color: #7f7f7f; font-size: 10px; line-height: 1.55; }
.permission-card {
  padding: 17px 15px;
  border: 1px solid #373737;
  border-radius: 17px;
  background: linear-gradient(145deg, #1d1d1d, #141414);
}
.permission-card > p { color: #9b9b9b; font-size: 11px; line-height: 1.65; }
.permission-tasks { margin-top: 15px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.permission-task { padding: 10px 6px; border-radius: 11px; background: #242424; text-align: center; }
.permission-task strong { display: block; color: #e2e2e2; font-size: 11px; }
.permission-task span { display: block; margin-top: 4px; color: #777; font-size: 9px; }
.level-system-list { display: grid; gap: 11px; }
.level-stage {
  overflow: hidden;
  border: 1px solid var(--guild-line);
  border-radius: 18px;
  background: var(--guild-panel);
}
.level-stage-head { min-height: 66px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; }
.level-stage-code {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #e9e8e4;
  color: #161616;
  font-size: 15px;
  font-weight: 800;
}
.level-stage:nth-child(2) .level-stage-code { background: #d4dae2; }
.level-stage:nth-child(3) .level-stage-code { background: #d5c59b; }
.level-stage:nth-child(4) .level-stage-code { background: #cab6dc; }
.level-stage-title { min-width: 0; flex: 1; }
.level-stage-title h3 { font-size: 14px; font-weight: 700; }
.level-stage-title p { margin-top: 5px; color: #777; font-size: 10px; }
.level-stage-body { padding: 14px 15px 16px; border-top: 1px solid #292929; }
.level-detail + .level-detail { margin-top: 13px; }
.level-detail h4 { color: #8a8a8a; font-size: 10px; font-weight: 600; }
.level-detail p { margin-top: 6px; color: #c2c2c2; font-size: 11px; line-height: 1.65; }
.level-detail ul { margin-top: 6px; padding-left: 17px; color: #c2c2c2; }
.level-detail li { font-size: 11px; line-height: 1.65; }
.note-card {
  padding: 15px;
  border: 1px solid #3a3425;
  border-radius: 15px;
  background: #1d1a13;
}
.note-card strong { color: #d2bd7a; font-size: 12px; }
.note-card p { margin-top: 8px; color: #a79b79; font-size: 10px; line-height: 1.65; }

.policy-hero { padding: 13px 8px 8px; text-align: center; }
.policy-kicker { color: #8b8b8b; font-size: 10px; letter-spacing: 2px; }
.policy-hero h2 { margin-top: 10px; font-size: 25px; line-height: 1.35; letter-spacing: -.5px; }
.policy-hero p { max-width: 310px; margin: 13px auto 0; color: #838383; font-size: 11px; line-height: 1.7; }
.policy-stack { margin-top: 24px; display: grid; gap: 12px; }
.policy-card {
  padding: 17px 15px;
  border: 1px solid var(--guild-line);
  border-radius: 18px;
  background: var(--guild-panel);
}
.policy-head { display: flex; align-items: center; gap: 10px; }
.policy-number {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eeeeeb;
  color: #151515;
  font-size: 10px;
  font-weight: 800;
}
.policy-head h3 { font-size: 15px; font-weight: 700; }
.policy-card > p, .policy-body > p { margin-top: 12px; color: #9a9a9a; font-size: 11px; line-height: 1.72; }
.policy-points { margin: 12px 0 0 17px; color: #b0b0b0; }
.policy-points li { font-size: 11px; line-height: 1.68; }
.policy-points li + li { margin-top: 5px; }
.tier-list { margin-top: 14px; overflow: hidden; border: 1px solid #303030; border-radius: 12px; }
.tier-row { min-height: 43px; padding: 0 12px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; background: #141414; }
.tier-row + .tier-row { border-top: 1px solid #292929; }
.tier-code { color: #d2bd7a; font-size: 11px; font-weight: 750; }
.tier-name { color: #a7a7a7; font-size: 10px; }
.tier-value { color: #ededed; font-size: 11px; font-weight: 680; }
.policy-subtitle { margin-top: 15px; color: #d1d1d1; font-size: 12px; font-weight: 680; }
.source-note { margin-top: 10px; padding: 10px 11px; border-radius: 10px; background: #202020; color: #858585; font-size: 10px; line-height: 1.6; }
.allowance-list { margin-top: 14px; overflow: hidden; border-radius: 12px; background: #121212; }
.allowance-row { min-height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.allowance-row + .allowance-row { border-top: 1px solid #292929; }
.allowance-row span { color: #919191; font-size: 10px; }
.allowance-row strong { color: #e5d298; font-size: 12px; }
.declaration-card { border-color: #443d2c; background: linear-gradient(145deg, #211d14, #171510); }
.declaration-card .policy-number { background: #d1bb78; }
.declaration-card > p { color: #b3a77f; }

.flow-intro { padding: 5px 3px 2px; }
.flow-intro > h2 { font-size: 22px; line-height: 1.35; letter-spacing: -.35px; }
.flow-steps { margin-top: 20px; display: grid; gap: 10px; }
.flow-step {
  padding: 15px;
  border: 1px solid var(--guild-line);
  border-radius: 16px;
  background: var(--guild-panel);
}
.flow-step h3 { font-size: 13px; font-weight: 700; }
.flow-step p { margin-top: 8px; color: #898989; font-size: 11px; line-height: 1.7; }
.flow-step-lines { margin-top: 7px; display: grid; gap: 4px; color: #a2a2a2; font-size: 10px; line-height: 1.55; }
.special-list { margin-top: 10px; padding-left: 18px; color: #aa9e7a; }
.special-list li { font-size: 10px; line-height: 1.65; }

.create-form { display: grid; gap: 19px; padding: 4px 0 2px; }
.form-field label, .logo-field legend { display: block; margin: 0 8px 9px; color: #efefef; font-size: 13px; font-weight: 650; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  outline: 0;
  background: #191919;
  color: #ededed;
  font-size: 12px;
}
.form-field input, .form-field select { height: 48px; padding: 0 14px; }
.form-field textarea { min-height: 104px; padding: 13px 14px; line-height: 1.6; resize: none; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #626262; }
.form-field select:invalid { color: #686868; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #626262; }
.form-field.is-error input, .form-field.is-error select, .form-field.is-error textarea { border-color: #a94d4d; }
.field-error { display: none; margin: 6px 8px 0; color: #d77474; font-size: 10px; }
.form-field.is-error .field-error { display: block; }
.logo-field { min-width: 0; border: 0; }
.logo-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.logo-option {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #252525;
  color: #111;
  font-size: 25px;
  font-weight: 800;
  cursor: pointer;
}
.logo-option input { position: absolute; opacity: 0; pointer-events: none; }
.logo-option.is-selected { border-color: #f5f5f5; box-shadow: 0 0 0 1px #222; }
.logo-option.is-selected::after {
  content: "✓";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4f4f4;
  color: #171717;
  font-size: 10px;
}
.logo-option.upload { border: 1px solid #666; background: #1b1b1b; color: #8d8d8d; font-size: 10px; font-weight: 500; }
.upload-mark { display: grid; justify-items: center; gap: 4px; }
.upload-mark strong { font-size: 27px; line-height: 1; font-weight: 300; }
.logo-option.logo-green { background: #45c880; color: #fff; }
.logo-option.logo-yellow { background: #f0e91c; }
.logo-option.logo-orange { background: #ff6311; }
.logo-option.logo-red { background: #d9294b; color: #fff; }
.logo-option.logo-amber { background: #f7b911; }
.logo-option.logo-black { background: #050505; color: #e9e9e9; }
.logo-option.logo-cyan { background: #3bc4bd; color: #fff; }
.logo-preview { width: 100%; height: 100%; object-fit: cover; }
.form-message { min-height: 16px; color: #d77474; text-align: center; font-size: 10px; }

.success-state { min-height: 100%; display: grid; align-content: center; justify-items: center; padding: 36px 20px; text-align: center; }
.success-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9e9e6;
  color: #171717;
  font-size: 30px;
  font-weight: 760;
}
.success-state h2 { margin-top: 22px; font-size: 23px; }
.success-state > p { margin-top: 11px; color: #8f8f8f; font-size: 11px; line-height: 1.7; }
.application-card { width: 100%; margin-top: 25px; padding: 16px; border: 1px solid #333; border-radius: 15px; background: #171717; text-align: left; }
.application-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.application-row + .application-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid #292929; }
.application-row span { color: #7e7e7e; font-size: 10px; }
.application-row strong { color: #e5e5e5; font-size: 11px; }
.review-status { color: #d4bb72 !important; }

.bottom-action {
  flex: 0 0 auto;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(255,255,255,.05);
  background: rgba(9, 9, 9, .96);
}
.primary-button, .secondary-button {
  width: 100%;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}
.primary-button { border: 0; background: #f2f1ed; color: #151515; }
.primary-button:disabled { background: #3a3a3a; color: #777; cursor: default; }
.secondary-button { border: 1px solid #444; background: #181818; color: #efefef; }

.sheet {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(2px);
}
.sheet-card {
  width: 100%;
  padding: 12px 16px max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid #383838;
  border-radius: 22px 22px 0 0;
  background: #181818;
  box-shadow: 0 -18px 50px rgba(0,0,0,.5);
}
.sheet-grabber { width: 38px; height: 4px; margin: 0 auto 18px; border-radius: 999px; background: #454545; }
.sheet-card h2 { font-size: 17px; }
.sheet-card p { margin-top: 10px; color: #898989; font-size: 12px; line-height: 1.65; }
.invite-code-field { margin-top: 18px; }
.invite-code-field label { display: block; margin: 0 2px 8px; color: #dcdcdc; font-size: 11px; font-weight: 650; }
.invite-code-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  outline: 0;
  background: #101010;
  color: #f0f0f0;
  font-size: 13px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.invite-code-field input::placeholder { color: #626262; letter-spacing: 0; text-transform: none; }
.invite-code-field input:focus { border-color: #777; }
.invite-code-field.is-error input { border-color: #a94d4d; }
.invite-code-error { min-height: 16px; margin: 6px 2px 0 !important; color: #d77474 !important; font-size: 10px !important; }
.sheet-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 9px; margin-top: 21px; }
.sheet-actions button { min-height: 44px; border-radius: 14px; font-size: 13px; font-weight: 680; cursor: pointer; }
.sheet-cancel { border: 1px solid #3c3c3c; background: #222; color: #ddd; }
.sheet-confirm { border: 0; background: #f1f0eb; color: #171717; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 66px;
  z-index: 100;
  max-width: calc(100% - 38px);
  padding: 9px 14px;
  border: 1px solid #3c3c3c;
  border-radius: 999px;
  background: rgba(35, 35, 35, .97);
  color: #eee;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .page-scroll { padding-bottom: 26px; }
}
