/* Nocrai Studio — shared shell styles */

/* ── Design tokens ──────────────────────────────────────────────────────────── */
:root {
  --studio-ink:        #0C2462; /* family navy — headings, body emphasis, primary text */
  --studio-text:       #1f2937; /* body text */
  --studio-sub:        #5b6472; /* secondary text */
  --studio-surface:    #FFFFFF; /* page background */
  --studio-card:       #F5F1E8; /* family cream — cards, panels, sections */
  --studio-border:     #E3DBD7; /* family cool neutral — borders, dividers */
  --studio-accent:     #E9A23B; /* Studio warm amber — CTAs, highlights, Buy button */
  --studio-accent-hi:  #C97F1B; /* amber hover / active */
  --studio-accent-soft:#F6DEC2; /* family soft accent — subtle highlights, badges */
  --studio-danger:     #B3261E; /* errors only */

  --studio-font: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --studio-max-w: 1100px;
  --studio-radius: 6px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--studio-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--studio-text);
  background: var(--studio-surface);
  -webkit-font-smoothing: antialiased;
}

/* ── Page shell ─────────────────────────────────────────────────────────────── */
.studio-header {
  background: var(--studio-surface);
  border-bottom: 1px solid var(--studio-border);
  padding: 0 1.5rem;
}
.studio-header__inner {
  max-width: var(--studio-max-w);
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.studio-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.studio-logo__mark {
  display: block;
  width: 28px;
  height: 28px;
}
.studio-logo__wordmark {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--studio-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.studio-main {
  max-width: var(--studio-max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.studio-footer {
  border-top: 1px solid var(--studio-border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--studio-sub);
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  color: var(--studio-ink);
  font-weight: 700;
  line-height: 1.25;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
p  { color: var(--studio-text); }
small { color: var(--studio-sub); font-size: 0.8125rem; }

/* ── Form elements ──────────────────────────────────────────────────────────── */
.studio-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--studio-border);
  border-radius: var(--studio-radius);
  font-family: var(--studio-font);
  font-size: 0.9375rem;
  color: var(--studio-text);
  background: var(--studio-surface);
  transition: border-color 0.15s;
}
.studio-input:focus {
  outline: none;
  border-color: var(--studio-ink);
  box-shadow: 0 0 0 3px rgba(12, 36, 98, 0.1);
}
.studio-input::placeholder { color: var(--studio-sub); }

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--studio-ink);
  margin-bottom: 0.25rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.studio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5625rem 1.25rem;
  border-radius: var(--studio-radius);
  font-family: var(--studio-font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.studio-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Primary: ink fill / white text */
.studio-btn--primary {
  background: var(--studio-ink);
  border-color: var(--studio-ink);
  color: #ffffff;
}
.studio-btn--primary:hover:not(:disabled) {
  background: #0a1e52;
  border-color: #0a1e52;
}

/* Secondary: ink outline on white */
.studio-btn--secondary {
  background: var(--studio-surface);
  border-color: var(--studio-ink);
  color: var(--studio-ink);
}
.studio-btn--secondary:hover:not(:disabled) {
  background: var(--studio-card);
}

/* Accent / Buy: amber fill — MUST use --studio-ink text, never white (contrast law) */
.studio-btn--accent {
  background: var(--studio-accent);
  border-color: var(--studio-accent);
  color: var(--studio-ink); /* amber is a light colour; white-on-amber fails contrast */
}
.studio-btn--accent:hover:not(:disabled) {
  background: var(--studio-accent-hi);
  border-color: var(--studio-accent-hi);
  color: var(--studio-ink);
}

/* ── License slot panel ─────────────────────────────────────────────────────── */
.studio-license-panel {
  background: var(--studio-card);
  border: 1px solid var(--studio-border);
  border-radius: var(--studio-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
}

.studio-license-label {
  /* inherits <label> styles above */
}

.studio-license-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.studio-license-status {
  font-size: 0.875rem;
  color: var(--studio-sub);
  min-height: 1.2em;
}
.studio-license-status--error {
  color: var(--studio-danger);
}

/* ── Preview watermark ──────────────────────────────────────────────────────── */
/* Apply .studio-preview--watermarked to the container holding the live preview. */
.studio-preview--watermarked {
  position: relative;
  filter: saturate(0.55);
}
.studio-preview--watermarked::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 80px,
    rgba(12, 36, 98, 0.10) 80px,  /* --studio-ink at ~10% opacity */
    rgba(12, 36, 98, 0.10) 81px
  );
  /* SVG data URI renders the repeating diagonal text */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='120'%3E%3Ctext transform='rotate(-35 170 60)' x='20' y='70' font-family='system-ui,sans-serif' font-size='13' font-weight='600' fill='%230C2462' fill-opacity='0.10' letter-spacing='2'%3EPREVIEW — NOCRAI STUDIO%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  z-index: 1;
}
