/* ============================================================
   style.css — Shared mobile styles for Kiosk Brand Customizer
   ============================================================ */

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

:root {
  --yellow: #FFC300;
  --yellow-dark: #e6b000;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.12);
  --header-height: 56px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-bottom: 24px;
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 480px;
  height: var(--header-height);
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.app-header h1 {
  color: var(--yellow);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.app-header .step-badge {
  position: absolute;
  right: 16px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
}

/* ── Page wrapper ── */
.page-wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
}

/* ── Canvas section ── */
.canvas-section {
  width: 100%;
  background: #2a2a2a;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
}

#kioskCanvas {
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-width: 100%;
}

/* ── Controls section ── */
.controls-section {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Input fields ── */
.input-row {
  display: flex;
  gap: 10px;
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input,
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.input-group input:focus,
.form-group input:focus {
  border-color: var(--yellow);
}

.input-group input::placeholder,
.form-group input::placeholder {
  color: #bbb;
}

/* ── Form groups ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-group .field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Validation message ── */
.validation-msg {
  font-size: 12px;
  color: #e53935;
  font-weight: 500;
  min-height: 16px;
  padding: 0 2px;
  display: none;
}

.validation-msg.visible {
  display: block;
}

/* ── Upload button ── */
.upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 20px;
  border: 2px dashed #ccc;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.upload-btn:hover,
.upload-btn:active {
  border-color: var(--yellow);
  background: #fffbe6;
  color: var(--text);
}

.upload-btn .upload-icon {
  font-size: 32px;
  line-height: 1;
}

.upload-btn .upload-label {
  font-weight: 600;
  color: var(--text);
}

.upload-btn .upload-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-status {
  font-size: 13px;
  color: #43A047;
  font-weight: 600;
  text-align: center;
  min-height: 20px;
}

/* ── Color swatches ── */
.swatches-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 0;
}

.swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
  transform: scale(1.1);
}

/* ── Next / Action button ── */
.btn-next {
  width: 100%;
  padding: 16px;
  background: var(--yellow);
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  margin-top: auto;
}

.btn-next:hover {
  background: var(--yellow-dark);
}

.btn-next:active {
  transform: scale(0.98);
  background: var(--yellow-dark);
}

.btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Back link ── */
.back-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px;
  display: block;
}

.back-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ── Progress dots ── */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 4px;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  transition: background 0.2s, width 0.2s;
}

.progress-dots .dot.active {
  background: var(--yellow);
  width: 24px;
  border-radius: 4px;
}

.progress-dots .dot.done {
  background: #aaa;
}

/* ── Confirmation page ── */
.confirm-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  flex: 1;
  gap: 24px;
}

.confirm-icon {
  font-size: 72px;
  line-height: 1;
}

.confirm-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.confirm-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

.confirm-summary {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
  text-align: left;
}

.confirm-summary h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 700;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 12px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.summary-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.btn-restart {
  width: 100%;
  max-width: 360px;
  padding: 16px;
  background: var(--yellow);
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-restart:hover {
  background: var(--yellow-dark);
}

/* ── Card wrapper for controls ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

/* ── Logo preview thumbnail ── */
.logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: var(--radius);
  border: 1px solid #eee;
}

.logo-preview-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #eee;
}

.logo-preview-info {
  flex: 1;
  min-width: 0;
}

.logo-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-preview-change {
  font-size: 12px;
  color: var(--yellow-dark);
  cursor: pointer;
  font-weight: 600;
  margin-top: 2px;
  display: inline-block;
}

/* ── Scrollable body on small screens ── */
@media (max-height: 700px) {
  .canvas-section {
    padding: 8px 16px;
  }
}
