/* ── Reset & Base ── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: #6366f1;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.text-center {
  text-align: center;
}

/* ── Nav ── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: #1a1a1a;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: #555;
  font-size: 0.95rem;
}

.nav-links a.active {
  color: #6366f1;
  font-weight: 600;
}

/* ── Buttons ── */

.btn-primary {
  display: inline-block;
  background: #6366f1;
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  text-decoration: none;
}

.btn-primary:hover {
  background: #5558e6;
  text-decoration: none;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #c7c8e8;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: #6366f1;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: 2px solid #6366f1;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #6366f1;
  color: #fff;
  text-decoration: none;
}

.btn-danger {
  display: inline-block;
  background: transparent;
  color: #ef4444;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-small {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.15rem;
}

/* ── Hero ── */

.hero {
  padding: 6rem 1.5rem 4rem;
  text-align: center;
  background: linear-gradient(135deg, #f8f7ff 0%, #eef0ff 50%, #f5f0ff 100%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #555;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* ── Features ── */

.features {
  padding: 4rem 1.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #eee;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: #6366f1;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.feature-card p {
  color: #666;
  font-size: 0.95rem;
}

/* ── CTA Section ── */

.cta-section {
  padding: 4rem 1.5rem;
  background: #fafafa;
}

.cta-section h2 {
  margin-bottom: 0.75rem;
}

.cta-section p {
  color: #666;
  margin-bottom: 1.5rem;
}

/* ── Auth Card ── */

.auth-card {
  max-width: 400px;
  margin: 8vh auto 0;
  padding: 2.5rem 2rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eee;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.auth-card h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-hint {
  display: block;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

.auth-card input[type="email"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}

.auth-card input[type="email"]:focus {
  border-color: #6366f1;
}

.auth-card .btn-primary {
  width: 100%;
}

.form-status {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-status-success {
  color: #16a34a;
}

.form-status-error {
  color: #ef4444;
}

.error-message {
  display: block;
  color: #ef4444;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  padding: 0.5rem;
  background: #fef2f2;
  border-radius: 6px;
}

/* ── Profile ── */

.profile-header {
  margin-bottom: 2rem;
}

.profile-header h2 {
  margin-bottom: 0.25rem;
}

.profile-header p {
  color: #666;
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.board-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
}

.board-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.board-meta {
  font-size: 0.85rem;
  color: #888;
}

.board-card-actions {
  display: flex;
  gap: 0.5rem;
}

.empty-state {
  color: #888;
  padding: 2rem 0;
}

/* ── Pricing ── */

.pricing-header {
  padding: 3rem 0 2rem;
}

.pricing-header h2 {
  margin-bottom: 0.5rem;
}

.pricing-header p {
  color: #666;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  padding: 2rem 1.5rem;
  border: 2px solid #eee;
  border-radius: 12px;
  text-align: center;
}

.pricing-card-featured {
  border-color: #6366f1;
  position: relative;
}

.pricing-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1a1a1a;
  margin: 1rem 0;
}

.pricing-features {
  list-style: none;
  margin: 1.5rem 0;
  text-align: left;
}

.pricing-features li {
  padding: 0.4rem 0;
  color: #555;
  font-size: 0.95rem;
}

.pricing-features li::before {
  content: "\2713 ";
  color: #6366f1;
  font-weight: 700;
}

/* ── Editor Layout ── */

.editor-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
  color: #444;
  font-size: 0.85rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #ccc;
}

.toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.toolbar-btn-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.toolbar-btn-accent {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.toolbar-btn-accent:hover:not(:disabled) {
  background: #5558e6;
  border-color: #5558e6;
  color: #fff;
}

.toolbar-label {
  display: none;
}

@media (min-width: 600px) {
  .toolbar-label {
    display: inline;
  }
}

.toolbar-select {
  padding: 0.45rem 0.6rem;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  cursor: pointer;
}

.save-status {
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
}

/* ── Board Canvas ── */

.editor-canvas-wrapper {
  flex: 1;
  overflow: auto;
  background: #f5f5f5;
  position: relative;
}

.board {
  width: 100%;
  height: 100%;
  min-height: 100%;
  position: relative;
}

.board-content {
  width: 100%;
  height: 100%;
  min-height: 600px;
  position: relative;
  overflow: hidden;
}

/* ── Board Items ── */

.board-item {
  position: absolute;
  cursor: grab;
  user-select: none;
  touch-action: none;
  border: var(--item-border, none);
  border-radius: var(--item-border-radius, 0);
  box-shadow: var(--item-shadow, 0 2px 8px rgba(0, 0, 0, 0.15));
  padding: var(--item-padding, 0);
  background: var(--item-bg, transparent);
  transition: box-shadow 0.2s;
}

.board-item:active {
  cursor: grabbing;
}

.board-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  filter: var(--item-filter, none);
  pointer-events: none;
}

.board-item.selected {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* ── Resize Handles ── */

.resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #6366f1;
  border-radius: 50%;
  z-index: 10;
  touch-action: none;
}

.resize-handle-nw {
  top: -7px;
  left: -7px;
  cursor: nw-resize;
}
.resize-handle-ne {
  top: -7px;
  right: -7px;
  cursor: ne-resize;
}
.resize-handle-sw {
  bottom: -7px;
  left: -7px;
  cursor: sw-resize;
}
.resize-handle-se {
  bottom: -7px;
  right: -7px;
  cursor: se-resize;
}

.rotate-handle {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: #6366f1;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: grab;
  z-index: 10;
  touch-action: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ── Export Modal ── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 460px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-content h3 {
  margin-bottom: 1.25rem;
}

.export-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.export-tab {
  flex: 1;
  padding: 0.6rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.export-tab.active {
  border-color: #6366f1;
  color: #6366f1;
  background: #f5f5ff;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.export-options label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;
}

.export-options select {
  padding: 0.6rem 0.75rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
}

.export-options .btn-primary {
  margin-top: 0.5rem;
}

/* ── Compliance Pages ── */

.compliance-page {
  max-width: 680px;
}

.compliance-page h2 {
  margin-bottom: 1rem;
}

.compliance-page h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.compliance-page p {
  color: #444;
  margin-bottom: 0.75rem;
}

/* ── Footer ── */

.compliance-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: #aaa;
}

.compliance-footer a {
  color: #aaa;
}

.compliance-footer a:hover {
  color: #666;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .hero {
    padding: 4rem 1rem 3rem;
  }

  .auth-card {
    margin-top: 4vh;
    padding: 2rem 1.25rem;
    border: none;
    box-shadow: none;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .board-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .resize-handle {
    width: 20px;
    height: 20px;
  }

  .resize-handle-nw {
    top: -10px;
    left: -10px;
  }
  .resize-handle-ne {
    top: -10px;
    right: -10px;
  }
  .resize-handle-sw {
    bottom: -10px;
    left: -10px;
  }
  .resize-handle-se {
    bottom: -10px;
    right: -10px;
  }

  .rotate-handle {
    width: 24px;
    height: 24px;
    top: -36px;
  }
}
