/* Éditeur Cercle Rachmaninoff — обвязка UI (страницы стилизует v3/styles.css). */

html, body { margin: 0; background: #14201b; color: #F7F2E9; font-family: 'Inter', sans-serif; font-size: 14px; }
.hidden { display: none !important; }
button { cursor: pointer; }

.btn {
  background: #1E3A2F; color: #F7F2E9; border: 1px solid #3a5949;
  padding: 8px 14px; border-radius: 4px; font-family: inherit; font-size: 13px;
  white-space: nowrap;
}
.btn:hover { border-color: #C9B48A; }
.btn-gold { background: #C9B48A; color: #1D1A17; border-color: #9D7C4A; font-weight: 600; }
.btn-ghost { background: transparent; border-color: transparent; color: #B8A99A; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* Вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 360px; background: #1E3A2F; border: 1px solid #3a5949; border-radius: 8px;
  padding: 36px; display: flex; flex-direction: column; gap: 12px;
}
.login-brand { text-align: center; margin-bottom: 14px; }
.login-cr {
  width: 74px; height: 74px; margin: 0 auto 12px; border: 1.5px solid rgba(201,180,138,0.8);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-size: 34px; color: #C9B48A;
}
.login-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; }
.login-sub { color: #B8A99A; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }
.login-card input {
  width: 100%; box-sizing: border-box; background: #14201b; color: #F7F2E9;
  border: 1px solid #3a5949; border-radius: 4px; padding: 10px 12px; font-size: 15px;
  margin: 6px 0 12px;
}
#login-code { text-align: center; letter-spacing: 10px; font-size: 22px; }
.login-card .btn { width: 100%; margin-top: 2px; }
.login-msg { min-height: 18px; font-size: 12.5px; color: #C9B48A; text-align: center; }
.fld-label { font-size: 12px; color: #B8A99A; letter-spacing: 0.4px; }

/* Шапка */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: #0f1713; border-bottom: 1px solid #2a3d33; position: sticky; top: 0; z-index: 50;
}
.brand { font-family: 'Cormorant Garamond', serif; font-size: 17px; margin-right: 8px; white-space: nowrap; }
.brand-cr { color: #C9B48A; }
.topbar select, .topbar input {
  background: #14201b; color: #F7F2E9; border: 1px solid #3a5949; border-radius: 4px;
  padding: 7px 10px; font-family: inherit; font-size: 13px;
}
#snap-label { width: 190px; }
.topbar-spacer { flex: 1; }
.save-status { font-size: 12px; color: #B8A99A; white-space: nowrap; }
.save-status.dirty { color: #e0b64f; }

.banner {
  background: #5C2A2A; color: #F7F2E9; padding: 9px 16px; font-size: 13px;
  display: flex; gap: 14px; align-items: center;
}
.banner .btn { padding: 4px 10px; font-size: 12px; }

.progress { padding: 8px 16px; background: #0f1713; display: flex; align-items: center; gap: 12px; }
#progress-bar {
  height: 6px; background: #C9B48A; border-radius: 3px; width: 0;
  transition: width 0.2s; min-width: 2px; max-width: 420px; flex: 0 1 420px;
}
#progress-text { font-size: 12px; color: #B8A99A; }

/* Основная сетка */
.main { display: grid; grid-template-columns: minmax(430px, 46%) 1fr; gap: 0; }
.preview-col { padding: 16px; border-right: 1px solid #2a3d33; }
.pagenav { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.pagenav select { flex: 1; background: #14201b; color: #F7F2E9; border: 1px solid #3a5949; border-radius: 4px; padding: 7px 10px; }
.pagenav .btn { font-size: 18px; padding: 4px 12px; }

.preview { position: sticky; top: 118px; }
.preview .sheet {
  transform: scale(var(--pv-scale, 0.46)); transform-origin: top left;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.preview { height: calc(1276px * var(--pv-scale, 0.46)); overflow: hidden; }

/* Панель полей */
.panel-col { padding: 16px 20px 60px; }
.panel-title { font-family: 'Cormorant Garamond', serif; font-size: 21px; margin: 4px 0 14px; color: #F7F2E9; }
.panel { display: flex; flex-direction: column; gap: 13px; max-width: 640px; }
.fld label { display: block; font-size: 11.5px; letter-spacing: 0.4px; color: #B8A99A; margin-bottom: 4px; }
.fld input, .fld textarea {
  width: 100%; box-sizing: border-box; background: #1b2a23; color: #F7F2E9;
  border: 1px solid #3a5949; border-radius: 4px; padding: 8px 10px;
  font-family: inherit; font-size: 13.5px; line-height: 1.45;
}
.fld textarea { resize: vertical; min-height: 60px; }
.fld textarea.tall { min-height: 120px; }
.fld input:focus, .fld textarea:focus { outline: none; border-color: #C9B48A; }
.panel-help { margin-top: 22px; font-size: 12px; color: #7e8f86; line-height: 1.6; max-width: 640px; }
.panel-help code { background: #1b2a23; padding: 1px 5px; border-radius: 3px; }

/* Скрытая сцена: полноразмерные страницы для рендера/экспорта */
.stage { position: absolute; top: 0; left: -30000px; }
.stage .sheet { margin-bottom: 20px; }

.readonly .panel input, .readonly .panel textarea { opacity: 0.55; pointer-events: none; }
