/* ═══════════════════════════════════════════════════════════════════════════
   CONSTRUCOMPARA — Public Design System
   Shared tokens + components for public-facing pages (login, register,
   landing, 404, etc.). Mirrors proveedor-ds.css tokens for brand consistency.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── 1. TOKENS ──────────────────────────────────────────────────────────── */
:root {
  --cc-primary:       #0d3b44;
  --cc-primary-light: #15505c;
  --cc-primary-dark:  #082a30;
  --cc-accent:        #05A5CB;
  --cc-accent-light:  #e0f4fa;
  --cc-accent-dark:   #048fb3;
  --cc-orange:        #ff8000;
  --cc-orange-light:  #fff7ed;
  --cc-orange-dark:   #e67300;

  --cc-success:       #10b981;
  --cc-success-light: #ecfdf5;
  --cc-warning:       #f59e0b;
  --cc-warning-light: #fef3c7;
  --cc-error:         #ef4444;
  --cc-error-light:   #fef2f2;
  --cc-info:          #3b82f6;
  --cc-info-light:    #eff6ff;

  --cc-bg:            #f6f8fb;
  --cc-surface:       #ffffff;
  --cc-border:        #e2e8f0;
  --cc-border-light:  #f1f5f9;
  --cc-muted:         #94a3b8;
  --cc-subtle:        #64748b;
  --cc-body:          #475569;
  --cc-heading:       #0f172a;
  --cc-ink:           #1e293b;

  --cc-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --cc-text-xs:       11px;
  --cc-text-sm:       13px;
  --cc-text-base:     15px;
  --cc-text-md:       17px;
  --cc-text-lg:       20px;
  --cc-text-xl:       26px;
  --cc-text-2xl:      34px;
  --cc-text-3xl:      44px;

  --cc-radius-sm:     6px;
  --cc-radius-md:     10px;
  --cc-radius-lg:     14px;
  --cc-radius-xl:     20px;
  --cc-radius-full:   999px;

  --cc-shadow-sm:     0 1px 3px rgba(0,0,0,.06);
  --cc-shadow-md:     0 4px 14px rgba(0,0,0,.07);
  --cc-shadow-lg:     0 12px 32px rgba(15,23,42,.08);
  --cc-shadow-xl:     0 20px 50px rgba(15,23,42,.1);

  --cc-ease:          .15s ease;
  --cc-ease-med:      .25s ease;
}

/* ─── 2. BASE ────────────────────────────────────────────────────────────── */
.cc-public {
  font-family: var(--cc-font);
  color: var(--cc-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--cc-bg);
  min-height: 100vh;
}
.cc-public *, .cc-public *::before, .cc-public *::after {
  box-sizing: border-box;
}
.cc-public h1, .cc-public h2, .cc-public h3, .cc-public h4 {
  color: var(--cc-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

/* ─── 3. BUTTONS ─────────────────────────────────────────────────────────── */
.cc-pub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  border: none;
  border-radius: var(--cc-radius-md);
  font-family: var(--cc-font);
  font-size: var(--cc-text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--cc-ease-med);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.cc-pub-btn--primary {
  background: var(--cc-primary);
  color: #fff;
}
.cc-pub-btn--primary:hover {
  background: var(--cc-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--cc-shadow-md);
}
.cc-pub-btn--accent {
  background: var(--cc-accent);
  color: #fff;
}
.cc-pub-btn--accent:hover {
  background: var(--cc-accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--cc-shadow-md);
}
.cc-pub-btn--orange {
  background: var(--cc-orange);
  color: #fff;
}
.cc-pub-btn--orange:hover {
  background: var(--cc-orange-dark);
  transform: translateY(-1px);
  box-shadow: var(--cc-shadow-md);
}
.cc-pub-btn--ghost {
  background: transparent;
  color: var(--cc-primary);
  border: 1.5px solid var(--cc-border);
}
.cc-pub-btn--ghost:hover {
  border-color: var(--cc-primary);
  background: rgba(13,59,68,.04);
}
.cc-pub-btn--full {
  width: 100%;
}
.cc-pub-btn--lg {
  height: 54px;
  font-size: var(--cc-text-md);
  padding: 0 36px;
  border-radius: var(--cc-radius-lg);
}

/* ─── 4. FORM CARD ───────────────────────────────────────────────────────── */
.cc-form-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-xl);
  box-shadow: var(--cc-shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 480px;
}
.cc-form-card__title {
  font-size: var(--cc-text-xl);
  margin-bottom: 6px;
}
.cc-form-card__subtitle {
  color: var(--cc-subtle);
  font-size: var(--cc-text-sm);
  margin-bottom: 28px;
}

/* Input group */
.cc-input-group {
  margin-bottom: 20px;
}
.cc-input-group label {
  display: block;
  font-size: var(--cc-text-sm);
  font-weight: 500;
  color: var(--cc-ink);
  margin-bottom: 6px;
}
.cc-input-group input,
.cc-input-group select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--cc-border);
  border-radius: var(--cc-radius-md);
  font-family: var(--cc-font);
  font-size: var(--cc-text-base);
  color: var(--cc-ink);
  background: var(--cc-surface);
  transition: border-color var(--cc-ease), box-shadow var(--cc-ease);
  outline: none;
  box-sizing: border-box;
}
.cc-input-group input:focus,
.cc-input-group select:focus {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px rgba(5,165,203,.12);
}
.cc-input-group input::placeholder {
  color: var(--cc-muted);
}
.cc-input-group .cc-input-hint {
  font-size: var(--cc-text-xs);
  color: var(--cc-muted);
  margin-top: 4px;
}

/* Toggle (buyer/provider radio) */
.cc-toggle-group {
  display: flex;
  background: var(--cc-bg);
  border-radius: var(--cc-radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}
.cc-toggle-group label {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: var(--cc-radius-sm);
  font-size: var(--cc-text-sm);
  font-weight: 500;
  color: var(--cc-subtle);
  cursor: pointer;
  transition: all var(--cc-ease);
}
.cc-toggle-group input { display: none; }
.cc-toggle-group input:checked + span {
  display: block;
}
.cc-toggle-group label:has(input:checked) {
  background: var(--cc-surface);
  color: var(--cc-heading);
  box-shadow: var(--cc-shadow-sm);
  font-weight: 600;
}

/* Error alert */
.cc-alert {
  padding: 12px 16px;
  border-radius: var(--cc-radius-md);
  font-size: var(--cc-text-sm);
  font-weight: 500;
  margin-bottom: 20px;
}
.cc-alert--error {
  background: var(--cc-error-light);
  color: var(--cc-error);
  border: 1px solid rgba(239,68,68,.15);
}
.cc-alert--success {
  background: var(--cc-success-light);
  color: #059669;
  border: 1px solid rgba(16,185,129,.15);
}
.cc-alert--info {
  background: var(--cc-info-light);
  color: #2563eb;
  border: 1px solid rgba(59,130,246,.15);
}

/* Divider */
.cc-form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--cc-muted);
  font-size: var(--cc-text-xs);
}
.cc-form-divider::before,
.cc-form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cc-border);
}

/* Footer links */
.cc-form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: var(--cc-text-sm);
  color: var(--cc-subtle);
}
.cc-form-footer a {
  color: var(--cc-accent);
  text-decoration: none;
  font-weight: 600;
}
.cc-form-footer a:hover {
  text-decoration: underline;
}

/* ─── 5. AUTH LAYOUT (split-screen) ──────────────────────────────────────── */
.cc-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.cc-auth__brand {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(5,165,203,.15), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,128,0,.08), transparent 50%),
    linear-gradient(160deg, var(--cc-primary) 0%, var(--cc-primary-dark) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cc-auth__brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.cc-auth__logo {
  width: 200px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
.cc-auth__tagline {
  font-size: var(--cc-text-xl);
  font-weight: 700;
  text-align: center;
  max-width: 380px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.cc-auth__tagline-sub {
  font-size: var(--cc-text-base);
  font-weight: 400;
  opacity: .75;
  margin-top: 12px;
  text-align: center;
  max-width: 340px;
  position: relative;
  z-index: 1;
}
.cc-auth__trust {
  display: flex;
  gap: 24px;
  margin-top: 48px;
  position: relative;
  z-index: 1;
}
.cc-auth__trust-item {
  text-align: center;
}
.cc-auth__trust-value {
  display: block;
  font-size: var(--cc-text-lg);
  font-weight: 800;
}
.cc-auth__trust-label {
  display: block;
  font-size: var(--cc-text-xs);
  opacity: .7;
  margin-top: 2px;
}

.cc-auth__form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 32px;
  background: var(--cc-bg);
}

@media (max-width: 900px) {
  .cc-auth {
    grid-template-columns: 1fr;
  }
  .cc-auth__brand {
    padding: 40px 24px 32px;
    min-height: auto;
  }
  .cc-auth__logo { width: 140px; margin-bottom: 16px; }
  .cc-auth__tagline { font-size: var(--cc-text-lg); }
  .cc-auth__trust { gap: 16px; margin-top: 24px; }
  .cc-auth__form-side {
    padding: 32px 20px 48px;
  }
  .cc-form-card {
    padding: 28px 24px;
  }
}

/* ─── 6. ERROR PAGE ──────────────────────────────────────────────────────── */
.cc-error-page {
  padding: 80px 0 100px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,183,77,.12), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(5,165,203,.08), transparent 40%),
    linear-gradient(180deg, var(--cc-bg) 0%, #fff 100%);
}
.cc-error-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-xl);
  box-shadow: var(--cc-shadow-lg);
  text-align: center;
}
.cc-error-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--cc-radius-xl);
  background: var(--cc-warning-light);
  margin-bottom: 24px;
}
.cc-error-badge svg {
  width: 40px;
  height: 40px;
  color: var(--cc-warning);
}
.cc-error-code {
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--cc-radius-full);
  background: var(--cc-accent);
  color: #fff;
  font-size: var(--cc-text-sm);
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 16px;
}
.cc-error-title {
  font-size: var(--cc-text-2xl);
  font-weight: 800;
  margin-bottom: 10px;
}
.cc-error-text {
  color: var(--cc-subtle);
  font-size: var(--cc-text-base);
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.cc-error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cc-error-hint {
  color: var(--cc-muted);
  font-size: var(--cc-text-xs);
}
.cc-error-hint a {
  color: var(--cc-accent);
  text-decoration: none;
}
.cc-error-hint a:hover {
  text-decoration: underline;
}
@media (max-width: 600px) {
  .cc-error-card { padding: 32px 24px; }
  .cc-error-title { font-size: var(--cc-text-xl); }
}

/* ─── 7. FEATURE GRID (how-it-works, benefits) ──────────────────────────── */
.cc-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.cc-feature-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-lg);
  padding: 28px 24px;
  transition: transform var(--cc-ease-med), box-shadow var(--cc-ease-med);
}
.cc-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cc-shadow-md);
}
.cc-feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--cc-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.cc-feature-card__icon svg {
  width: 24px;
  height: 24px;
}
.cc-feature-card__icon--accent {
  background: var(--cc-accent-light);
  color: var(--cc-accent);
}
.cc-feature-card__icon--orange {
  background: var(--cc-orange-light);
  color: var(--cc-orange);
}
.cc-feature-card__icon--success {
  background: var(--cc-success-light);
  color: var(--cc-success);
}
.cc-feature-card h3 {
  font-size: var(--cc-text-md);
  font-weight: 700;
  margin-bottom: 6px;
}
.cc-feature-card p {
  font-size: var(--cc-text-sm);
  color: var(--cc-subtle);
  margin: 0;
  line-height: 1.5;
}

/* ─── 8. SECTION ─────────────────────────────────────────────────────────── */
.cc-pub-section {
  padding: 72px 0;
}
.cc-pub-section__head {
  text-align: center;
  margin-bottom: 40px;
}
.cc-pub-section__head h2 {
  font-size: var(--cc-text-2xl);
  margin-bottom: 8px;
}
.cc-pub-section__head p {
  font-size: var(--cc-text-base);
  color: var(--cc-subtle);
  max-width: 520px;
  margin: 0 auto;
}

/* ─── 9. KPI ROW ─────────────────────────────────────────────────────────── */
.cc-pub-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 32px 0;
}
.cc-pub-kpi {
  text-align: center;
  padding: 20px 12px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-lg);
}
.cc-pub-kpi__value {
  display: block;
  font-size: var(--cc-text-xl);
  font-weight: 800;
  color: var(--cc-heading);
}
.cc-pub-kpi__label {
  display: block;
  font-size: var(--cc-text-xs);
  color: var(--cc-subtle);
  margin-top: 4px;
}

/* ─── 10. CONTAINER ──────────────────────────────────────────────────────── */
.cc-pub-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}
