:root {
  --ink:        #12141A;
  --ink-raised: #1B1E27;
  --ink-line:   #2A2E3A;
  --paper:      #ECEAE3;
  --paper-dim:  #A7A79E;
  --brass:      #C99B4A;
  --brass-dim:  #8E6E37;
  --teal:       #4A7C82;
  --danger:     #C9634A;
  --font-fa: 'Vazirmatn', sans-serif;
  --font-brand: 'Space Grotesk', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-fa);
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; color: var(--paper-dim); }
input, select, textarea {
  font-family: var(--font-fa);
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  color: var(--paper);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.94rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brass); border-color: transparent; }
label { display: block; font-size: 0.86rem; color: var(--paper-dim); margin-bottom: 6px; }
.field { margin-bottom: 18px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; border-bottom: 1px solid var(--ink-line);
}
.brand { font-family: var(--font-brand); font-weight: 700; font-size: 1.2rem; }
.brand .accent { color: var(--brass); font-weight: 500; font-size: 0.9em; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px; border: 1px solid transparent;
  font-family: var(--font-fa); font-weight: 600; font-size: 0.92rem;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--brass); color: #16130B; }
.btn-primary:hover { background: #DBAE63; }
.btn-outline { background: transparent; border-color: var(--ink-line); color: var(--paper); }
.btn-outline:hover { border-color: var(--brass-dim); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--ink-raised); border: 1px solid var(--ink-line);
  border-radius: 12px; padding: 24px;
}

.notice {
  padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 18px;
}
.notice-error { background: rgba(201,99,74,0.12); border: 1px solid var(--danger); color: #E8998A; }
.notice-info { background: rgba(74,124,130,0.12); border: 1px solid var(--teal); color: #9FC3C6; }

.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.3rem; margin-bottom: 8px; }
.auth-card > p { margin-bottom: 26px; font-size: 0.92rem; }
.auth-toggle { margin-top: 18px; text-align: center; font-size: 0.88rem; }
.auth-toggle button { background: none; border: none; color: var(--brass); cursor: pointer; font-family: var(--font-fa); font-size: 0.88rem; padding: 0; }

.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin: 40px 0 28px; }
.dashboard-header h1 { font-size: 1.5rem; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 60px; }
.project-card { display: flex; flex-direction: column; gap: 10px; }
.project-card h3 { font-size: 1.05rem; }
.project-card .biz-tag { font-size: 0.82rem; color: var(--brass); }
.project-card .status { font-size: 0.8rem; color: var(--paper-dim); }
.project-card .btn { align-self: flex-start; margin-top: auto; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--paper-dim); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal { width: 100%; max-width: 420px; }
.modal h2 { font-size: 1.15rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* Builder layout */
.builder-shell { display: grid; grid-template-columns: 360px 1fr; min-height: calc(100vh - 68px); }
.builder-panel { border-left: 1px solid var(--ink-line); padding: 28px 24px; overflow-y: auto; max-height: calc(100vh - 68px); }
.builder-panel h2 { font-size: 1rem; margin: 26px 0 14px; color: var(--brass); }
.builder-panel h2:first-child { margin-top: 0; }
.color-row { display: flex; gap: 12px; }
.color-row .field { flex: 1; }
input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }

.offering-row { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--ink-line); border-radius: 8px; margin-bottom: 10px; }

.preview-pane { display: flex; flex-direction: column; background: var(--ink); }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--ink-line); }
.preview-toolbar .status-text { font-size: 0.84rem; color: var(--paper-dim); }
.preview-frame-wrap { flex: 1; padding: 20px; }
.preview-frame-wrap iframe { width: 100%; height: 100%; border: 1px solid var(--ink-line); border-radius: 10px; background: #fff; }

@media (max-width: 900px) {
  .builder-shell { grid-template-columns: 1fr; }
  .builder-panel { max-height: none; border-left: none; border-bottom: 1px solid var(--ink-line); }
}
