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

:root {
  --accent:      #0085FF;
  --accent-h:    #0070D8;
  --accent-dim:  rgba(0,133,255,0.10);
  --green:       #00C875;
  --green-dim:   rgba(0,200,117,0.10);
  --green-text:  #007A4D;
  --yellow:      #E08D00;
  --yellow-dim:  rgba(224,141,0,0.10);
  --red:         #D93025;
  --red-dim:     rgba(217,48,37,0.10);
  --border:      #E6E9EF;
  --text:        #1F2937;
  --text-2:      #6B7280;
  --text-3:      #9CA3AF;
  --bg:          #F5F6F8;
  --card:        #FFFFFF;
  --radius:      10px;
  --font-head:   'Syne', sans-serif;
  --font-body:   'Instrument Sans', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Auth Screen ──────────────────────────────────────────────────── */
#cp-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,133,255,0.08) 0%, transparent 60%);
}

.cp-auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  width: 420px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Logo */
.cp-logo { display: flex; align-items: center; gap: 13px; }
.cp-logo-mark {
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.cp-logo-name {
  font-family: var(--font-head);
  font-size: 19px; font-weight: 800;
  color: var(--text); line-height: 1.1;
}
.cp-logo-sub {
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 3px;
}

/* Heading */
.cp-heading h1 {
  font-family: var(--font-head);
  font-size: 22px; font-weight: 700;
  color: var(--text); letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.cp-heading p { font-size: 14px; color: var(--text-2); }

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

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

.form-input {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14.5px;
  color: var(--text); background: #fff;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,133,255,0.12);
}
.form-input.input-error { border-color: var(--red); }

/* Error box */
.cp-error {
  background: var(--red-dim);
  border: 1px solid rgba(217,48,37,0.2);
  color: var(--red);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px; font-weight: 500;
  line-height: 1.5;
}

/* Buttons */
.cp-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 11px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent;
  transition: background 0.13s, box-shadow 0.13s;
}
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); box-shadow: 0 2px 10px rgba(0,133,255,0.28); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.cp-btn-back {
  display: block; width: 100%; text-align: center;
  background: none; border: none;
  color: var(--text-2); font-family: var(--font-body); font-size: 13px;
  cursor: pointer; padding: 4px 0;
  transition: color 0.12s;
}
.cp-btn-back:hover { color: var(--text); }

/* ── Header ───────────────────────────────────────────────────────── */
.cp-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.cp-header-inner {
  max-width: 720px; margin: 0 auto;
  padding: 0 24px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
}
.cp-header-logo { display: flex; align-items: center; gap: 10px; }
.cp-header-mark { font-size: 20px; }
.cp-header-brand {
  font-family: var(--font-head); font-size: 16px; font-weight: 700;
  color: var(--text);
}
.cp-logout-btn {
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-2);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.cp-logout-btn:hover { background: var(--bg); color: var(--text); }

/* ── Dashboard Layout ─────────────────────────────────────────────── */
.cp-main { padding: 28px 24px; }

.cp-content {
  max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
}

/* Welcome block */
.cp-welcome {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 0 4px;
}
.cp-avatar {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 19px; font-weight: 700;
  color: #fff; text-transform: uppercase; flex-shrink: 0;
}
.cp-client-name {
  font-family: var(--font-head);
  font-size: 24px; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em;
}
.cp-client-boat {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-2); margin-top: 3px;
}

/* Alert */
.cp-alert {
  display: flex; gap: 14px; align-items: flex-start;
  border-radius: var(--radius); padding: 14px 16px;
}
.cp-alert-warn {
  background: var(--yellow-dim);
  border: 1px solid rgba(224,141,0,0.3);
}
.cp-alert-icon { font-size: 20px; flex-shrink: 0; line-height: 1.3; }
.cp-alert-title {
  font-weight: 700; font-size: 14px; color: var(--yellow); margin-bottom: 3px;
}
.cp-alert-body { font-size: 13px; color: #7a5200; line-height: 1.5; }

/* Cards */
.cp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cp-card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px 13px;
  border-bottom: 1px solid var(--border);
}
.cp-card-title {
  font-family: var(--font-head);
  font-size: 14.5px; font-weight: 700; color: var(--text);
}
.cp-history-count {
  font-size: 12px; color: var(--text-3); font-family: var(--font-mono);
}

/* Job rows */
.cp-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.cp-row:last-child { border-bottom: none; }

.cp-row-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.cp-icon-green { background: var(--green-dim); }
.cp-icon-blue  { background: var(--accent-dim); }

.cp-row-info { flex: 1; min-width: 0; }
.cp-row-primary { font-size: 14px; font-weight: 600; color: var(--text); }
.cp-row-date {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-2); margin-top: 2px;
}
.cp-row-notes {
  font-size: 12.5px; color: var(--text-2);
  margin-top: 4px; line-height: 1.5;
}

.cp-row-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 5px; flex-shrink: 0;
}

/* Badges */
.cp-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap;
}
.cp-badge-blue {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(0,133,255,0.2);
}
.cp-badge-warn {
  background: var(--yellow-dim); color: var(--yellow);
  border: 1px solid rgba(224,141,0,0.3);
}

/* Price */
.cp-price {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700; color: var(--green-text);
}

/* Empty state */
.cp-empty-card {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 48px 24px;
}
.cp-empty-icon { font-size: 36px; margin-bottom: 14px; opacity: 0.35; }
.cp-empty-title {
  font-family: var(--font-head); font-size: 17px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.cp-empty-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.6; max-width: 320px; }

/* Loyalty card */
.cp-loyalty-card { background: linear-gradient(135deg, rgba(245,158,11,0.08), transparent 70%); border-color: rgba(245,158,11,0.25) !important; }
.cp-loyalty-balance { display: flex; align-items: baseline; gap: 6px; padding: 10px 20px 4px; }
.cp-loyalty-num { font-size: 36px; font-weight: 800; color: #f59e0b; font-family: var(--font-head, sans-serif); line-height: 1; }
.cp-loyalty-label { font-size: 14px; font-weight: 700; color: #E08D00; text-transform: uppercase; letter-spacing: 0.05em; }
.cp-loyalty-hint { font-size: 12px; color: var(--text-2); padding: 0 20px 10px; }
.cp-loyalty-ready { font-size: 13px; font-weight: 600; color: #059669; background: rgba(0,200,117,0.1); border: 1px solid rgba(0,200,117,0.25); border-radius: 8px; margin: 0 20px 16px; padding: 10px 14px; }
.cp-loyalty-progress-wrap { height: 6px; background: rgba(245,158,11,0.15); border-radius: 99px; overflow: hidden; margin: 0 20px 6px; }
.cp-loyalty-progress-bar { height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); border-radius: 99px; min-width: 4px; }
.cp-loyalty-progress-label { font-size: 12px; color: var(--text-2); padding: 0 20px 16px; }

/* Contact card */
.cp-contact-card .cp-card-hd { border-bottom: none; }
.cp-contact-body {
  font-size: 14px; color: var(--text-2);
  padding: 2px 20px 16px; line-height: 1.6;
}
.cp-contact-btns {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 0 20px 20px;
}
.cp-contact-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.cp-contact-link:hover {
  border-color: var(--accent); background: var(--accent-dim); color: var(--accent);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .cp-auth-card { padding: 28px 20px; }
  .cp-header-brand { display: none; }
  .cp-main { padding: 20px 14px; }
  .cp-row { gap: 10px; padding: 12px 14px; }
  .cp-card-hd { padding: 13px 14px 11px; }
  .cp-client-name { font-size: 20px; }
  .cp-contact-body { padding: 4px 14px 14px; }
  .cp-contact-btns { padding: 0 14px 16px; }
}

/* ── Request Service Bar ──────────────────────────────────────────── */
.cp-request-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent) 0%, #0070D8 100%);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: 0 4px 14px rgba(0,133,255,0.25);
}
.cp-request-bar-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 700; color: #fff;
  margin-bottom: 2px;
}
.cp-request-bar-sub {
  font-size: 13px; color: rgba(255,255,255,0.80);
}
.cp-request-bar-btn {
  padding: 10px 22px; border-radius: 8px;
  background: #fff; color: var(--accent);
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  border: none; cursor: pointer; white-space: nowrap;
  transition: box-shadow 0.13s, transform 0.1s;
  flex-shrink: 0;
}
.cp-request-bar-btn:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.15); transform: translateY(-1px); }

/* Service request form card */
.cp-service-form-card {}
.cp-service-form {
  padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.cp-form-group { display: flex; flex-direction: column; gap: 5px; }
.cp-form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.cp-form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.cp-form-textarea { resize: vertical; min-height: 72px; }

/* Success state */
.cp-request-success {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 36px 24px; gap: 8px;
}
.cp-request-success-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green-dim); color: var(--green-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; margin-bottom: 4px;
}
.cp-request-success-title {
  font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--text);
}
.cp-request-success-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }

@media (max-width: 520px) {
  .cp-request-bar { flex-direction: column; align-items: flex-start; }
  .cp-request-bar-btn { width: 100%; text-align: center; }
}

/* ── Boat cards (admin panel) ─────────────────────────────────────── */
.boat-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.boat-card:last-child { border-bottom: none; }
.boat-card-info { flex: 1; min-width: 0; }
.boat-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.boat-card-details { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.boat-card-notes { font-size: 11.5px; color: var(--text-light); margin-top: 2px; font-style: italic; }
.boat-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Portal boat UI ───────────────────────────────────────────────── */
.cp-empty-sm {
  font-size: 13px; color: var(--text-muted); padding: 12px 20px 16px;
}
.cp-btn-sm {
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.12s;
}
.cp-btn-sm:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.cp-btn-sm.cp-btn-danger { border-color: rgba(217,48,37,0.3); color: #D93025; }
.cp-btn-sm.cp-btn-danger:hover { background: rgba(217,48,37,0.08); }

.cp-boat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-bottom: 1px solid var(--border-light);
}
.cp-boat-row:last-child { border-bottom: none; }

/* Portal boat form */
.cp-boat-form { padding: 14px 20px 16px; border-top: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 10px; }
.cp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cp-form-input {
  width: 100%; padding: 8px 11px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--bg-input, #f8f9fa);
  color: var(--text); font-family: var(--font-body); font-size: 13px;
}
.cp-form-input:focus { outline: none; border-color: var(--accent); }
.cp-form-btns { display: flex; gap: 8px; }
.cp-btn { padding: 8px 18px; border-radius: 8px; border: none; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.cp-btn:disabled { opacity: 0.6; }
.cp-btn.cp-btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.cp-form-err { font-size: 12.5px; color: #D93025; padding: 6px 0; }
@media (max-width: 520px) { .cp-form-row { grid-template-columns: 1fr; } }
