/* public/assets/css/app.css — estilos globales de PartLink (dark/light, auth, paneles). */

/* ===== MODO CLARO — blanco cálido, no blanco puro ===== */
:root,
[data-theme="light"] {
  --bg-base:        #F4F6F9;
  --bg-surface:     #FFFFFF;
  --bg-elevated:    #FFFFFF;
  --bg-subtle:      #EAEEF4;

  --text-primary:   #15233F;   /* azul marino del logo (texto "Part") */
  --text-secondary: #51607A;
  --text-muted:     #8A95AC;
  --text-inverse:   #FFFFFF;

  --border-default: #DCE2EC;

  --brand-primary:  #F47B20;   /* naranja del logo (texto "Link" / nodo central) */
  --brand-hover:    #DA6A12;
  --brand-light:    #FFF1E6;   /* naranja suave de fondo */
  --brand-navy:     #15233F;   /* azul marino */
  --brand-cyan:     #1CA3D8;   /* cian de los nodos */

  --success:    #2D9B6E;  --success-bg: #E8F7F0;
  --error:      #D94F4F;  --error-bg:   #FDEEEE;
  --warning:    #D97B2E;  --warning-bg: #FDF3E8;
  --info:       #1CA3D8;  --info-bg:    #E7F5FC;

  --shadow-sm: 0 1px 3px rgba(21,35,63,0.08);
  --shadow-md: 0 4px 12px rgba(21,35,63,0.10);
  --shadow-lg: 0 8px 24px rgba(21,35,63,0.12);
}

/* ===== MODO OSCURO — gris azulado, no negro puro ===== */
[data-theme="dark"] {
  --bg-base:        #0A0E1A;   /* azul-negro profundo del logo en fondo oscuro */
  --bg-surface:     #121A2C;
  --bg-elevated:    #1A2438;
  --bg-subtle:      #243049;

  --text-primary:   #EAEEF6;
  --text-secondary: #A6B2CC;
  --text-muted:     #6B7796;
  --text-inverse:   #0A0E1A;

  --border-default: #2A3450;

  --brand-primary:  #FF8A2B;   /* naranja más luminoso para fondo oscuro */
  --brand-hover:    #FFA050;
  --brand-light:    #2A1B0E;
  --brand-navy:     #15233F;
  --brand-cyan:     #38BDF8;

  --success:    #3DBF8A;  --success-bg: #0D2B1E;
  --error:      #E06060;  --error-bg:   #2B1515;
  --warning:    #E8943A;  --warning-bg: #2B1E0D;
  --info:       #38BDF8;  --info-bg:    #0C2030;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
}

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;  --radius-md: 10px;  --radius-lg: 16px;  --radius-full: 9999px;
  --transition: 150ms ease;  --transition-md: 250ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light dark; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-md), color var(--transition-md);
}
a { color: inherit; }

/* ===== Marca ===== */
/* Logo de marca: isotipo (PNG transparente) + wordmark CSS que adapta al tema. */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { height: 40px; width: auto; display: block; }
.brand__word { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); line-height: 1; }
.brand__word span { color: var(--brand-primary); }            /* "Link" en naranja */
.brand--lg { flex-direction: column; gap: 10px; }
.brand--lg .brand__mark { height: 64px; }
.brand--lg .brand__word { font-size: 30px; }
.brand-tagline { font-size: 13px; color: var(--text-secondary); margin-top: 10px; text-align: center; }
.back-home { font-size: 13px; color: var(--text-secondary); text-decoration: none; margin-right: auto; }
.back-home:hover { color: var(--brand-primary); }

/* Generador de contraseña */
.pwd-gen__out { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pwd-gen__out code {
  font-family: var(--font-mono, monospace); font-size: 15px; letter-spacing: 1px;
  background: var(--bg-subtle); color: var(--text-primary);
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-default);
}
.pwd-gen__ok { color: var(--success); font-size: 13px; font-weight: 500; }

/* ===== Controles de tema ===== */
.theme-btn {
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-full); width: 38px; height: 38px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all var(--transition); color: var(--text-secondary);
}
.theme-btn:hover { background: var(--bg-subtle); }

/* ===== AUTH ===== */
.auth-body { display: flex; flex-direction: column; min-height: 100vh; }
.auth-controls { display: flex; justify-content: flex-end; padding: 16px 24px; }
.auth-shell { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px 16px 56px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 36px 32px;
}
.auth-logo-wrap { text-align: center; margin-bottom: 24px; }
.auth-header { margin-bottom: 24px; }
.auth-title { font-size: 26px; font-weight: 600; color: var(--text-primary); }
.auth-subtitle { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }

/* ===== Formularios ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.forgot-link { font-size: 13px; color: var(--brand-primary); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.field-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.input-wrapper { position: relative; }
.form-input {
  width: 100%; padding: 11px 14px; background: var(--bg-elevated);
  border: 1.5px solid var(--border-default); border-radius: var(--radius-md);
  font-size: 15px; color: var(--text-primary); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.form-select { cursor: pointer; }

.input-with-action .form-input { padding-right: 46px; }
.input-action-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 4px; display: flex; align-items: center; border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.input-action-btn:hover { color: var(--text-secondary); }
.input-action-btn svg { width: 18px; height: 18px; }

/* Honeypot oculto fuera de pantalla */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Medidor de fuerza */
.password-strength { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.strength-bar { flex: 1; height: 4px; background: var(--border-default); border-radius: var(--radius-full); overflow: hidden; }
.strength-fill { height: 100%; width: 0; border-radius: var(--radius-full); transition: width .3s ease, background-color .3s ease; }
.strength-fill.weak   { width: 25%;  background: var(--error); }
.strength-fill.fair   { width: 50%;  background: var(--warning); }
.strength-fill.good   { width: 75%;  background: var(--info); }
.strength-fill.strong { width: 100%; background: var(--success); }
.strength-label { font-size: 12px; font-weight: 500; min-width: 50px; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; font-size: 15px; font-weight: 500; font-family: inherit;
  border: 1.5px solid transparent; border-radius: var(--radius-md);
  cursor: pointer; text-decoration: none; transition: all var(--transition);
}
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-outline:hover { background: var(--brand-light); }
.btn-ghost { background: transparent; border-color: var(--border-default); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ===== Alertas ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.alert-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info); }

.auth-footer-text { text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-secondary); }
.auth-link { color: var(--brand-primary); text-decoration: none; font-weight: 500; margin-left: 4px; }
.auth-link:hover { text-decoration: underline; }

/* Verificación */
.verify-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }
.verify-instruction { font-size: 14px; color: var(--text-secondary); line-height: 1.6; text-align: center; margin-bottom: 22px; }
.resend-countdown { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 12px; }

/* ===== Header app ===== */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--bg-base);
  border-bottom: 1px solid var(--border-default);
}
.app-header-right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; font-weight: 500; line-height: 1.2; }
.user-chip small { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.logout-form { margin: 0; }
.app-main { max-width: 1000px; margin: 0 auto; padding: 28px 20px; }

/* ===== Paneles ===== */
.panel-hero { margin-bottom: 24px; }
.panel-hero h1 { font-size: 26px; font-weight: 600; }
.muted { color: var(--text-secondary); margin-top: 4px; }
.panel-note { margin-top: 20px; font-size: 13px; color: var(--text-muted); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.action-card {
  display: flex; flex-direction: column; gap: 6px; padding: 20px;
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); text-decoration: none; color: inherit;
  transition: all var(--transition);
}
.action-card--primary { border-color: var(--brand-primary); }
a.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.action-card__icon { font-size: 26px; }
.action-card__title { font-weight: 600; font-size: 16px; }
.action-card__desc { font-size: 13px; color: var(--text-secondary); }

/* Badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500; margin-top: 10px; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--error   { background: var(--error-bg);   color: var(--error); }

/* ===== Landing ===== */
.landing-hero { max-width: 800px; margin: 0 auto; padding: 72px 20px 48px; text-align: center; }
.landing-title { font-size: 44px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.landing-title .accent { color: var(--brand-primary); }
.landing-sub { font-size: 18px; color: var(--text-secondary); margin: 20px auto 0; max-width: 620px; line-height: 1.6; }
.landing-cta { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }

.landing-steps { max-width: 960px; margin: 0 auto; padding: 32px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 24px; }
.step__num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--brand-cyan) 16%, transparent); color: var(--brand-cyan); font-weight: 700; margin-bottom: 12px; }
.step h3 { color: var(--brand-navy); }
[data-theme="dark"] .step h3 { color: var(--text-primary); }
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }

.landing-cats { max-width: 960px; margin: 0 auto; padding: 32px 20px; }
.landing-cats h2 { text-align: center; font-size: 26px; margin-bottom: 24px; }
.cats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cat-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 20px; }
.cat-card h3 { color: var(--brand-primary); margin-bottom: 10px; }
.cat-card ul { list-style: none; }
.cat-card li { padding: 4px 0; color: var(--text-secondary); font-size: 14px; border-bottom: 1px solid var(--border-default); }
.cat-card li:last-child { border-bottom: none; }

.landing-footer { text-align: center; padding: 32px 20px; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border-default); margin-top: 32px; }

/* ===== Formularios de Fase 2 ===== */
.form-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 24px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
textarea.form-input { resize: vertical; font-family: inherit; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.panel-hero--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.back-link { color: var(--text-secondary); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 8px; }
.back-link:hover { color: var(--brand-primary); }

/* Listas */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); text-decoration: none; color: inherit; transition: all var(--transition);
}
.list-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--brand-primary); }
.list-item__sub { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.list-item__meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.offers-pill { font-size: 13px; color: var(--brand-primary); font-weight: 500; white-space: nowrap; }

.empty-state {
  text-align: center; padding: 48px 24px; background: var(--bg-surface);
  border: 1px dashed var(--border-default); border-radius: var(--radius-lg);
}
.empty-state p { color: var(--text-secondary); margin-bottom: 16px; }

/* Detalle de solicitud */
.detail-grid { display: flex; flex-direction: column; gap: 24px; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 18px; }
.detail-list dt { color: var(--text-muted); font-size: 14px; }
.detail-list dd { font-weight: 500; }
.detail-desc h3, .offers-section h3 { margin-bottom: 8px; font-size: 17px; }
.detail-desc p { color: var(--text-secondary); line-height: 1.6; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border-default); }
.pdf-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pdf-chip { padding: 10px 16px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); text-decoration: none; color: var(--text-primary); font-size: 14px; }
.offers-section { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 18px; }

/* Preferencias del proveedor (chips) */
.pref-block { border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 18px; }
.pref-block legend { font-weight: 600; padding: 0 8px; color: var(--text-primary); }
.pref-group { margin-bottom: 14px; }
.pref-group__title { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1.5px solid var(--border-default); border-radius: var(--radius-full); cursor: pointer; font-size: 14px; user-select: none; transition: all var(--transition); }
.chip input { accent-color: var(--brand-primary); }
.chip:has(input:checked) { background: var(--brand-light); border-color: var(--brand-primary); color: var(--brand-primary); }

/* ===== Fase 3: ofertas, chat, calificaciones ===== */
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nav-link { position: relative; text-decoration: none; font-size: 20px; padding: 4px 6px; }
.unread-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand-primary); color: #fff; font-size: 11px; font-weight: 700;
}
.nav-link .unread-dot { position: absolute; top: -2px; right: -4px; }

.offer-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 16px 18px; }
.offer-card__main { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.offer-card__price { font-size: 20px; font-weight: 700; color: var(--brand-primary); }
.offer-card__prov a { color: var(--text-primary); text-decoration: none; font-weight: 500; }
.offer-card__prov a:hover { color: var(--brand-primary); }
.offer-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.offer-card__notes { margin-top: 10px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.offer-card .btn { margin-top: 12px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: var(--radius-full); background: var(--bg-subtle); font-size: 12px; color: var(--text-secondary); }
.verified-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--success); color: #fff; font-size: 12px; font-weight: 700; }
.rating-mini { color: var(--warning); font-weight: 600; font-size: 14px; }

/* Radio cards (cierre) */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card { border: 1.5px solid var(--border-default); border-radius: var(--radius-md); padding: 14px; cursor: pointer; transition: all var(--transition); }
.radio-card span { display: flex; flex-direction: column; }
.radio-card small { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.radio-card:has(input:checked) { border-color: var(--brand-primary); background: var(--brand-light); }
.radio-card input { margin-right: 6px; }

/* Estrellas de calificación */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars .star input { display: none; }
.stars .star span { font-size: 26px; color: var(--border-default); cursor: pointer; transition: color var(--transition); }
.stars .star:hover span, .stars .star:hover ~ .star span,
.stars .star input:checked ~ span { color: var(--warning); }
/* (row-reverse hace que :hover ilumine la estrella y las anteriores) */
.stars .star input:checked + span { color: var(--warning); }

/* Chat */
.chat { display: flex; flex-direction: column; height: 60vh; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.chat__messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 75%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.msg p { margin: 0; word-wrap: break-word; }
.msg__time { display: block; font-size: 10px; opacity: .65; margin-top: 3px; text-align: right; }
.msg--mine { align-self: flex-end; background: var(--brand-primary); color: #fff; border-bottom-right-radius: 4px; }
.msg--other { align-self: flex-start; background: var(--bg-subtle); color: var(--text-primary); border-bottom-left-radius: 4px; }
.chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border-default); }
.chat__form .form-input { flex: 1; }

/* ===== Fase 4: panel administrativo ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 18px; text-align: center; }
.stat-card--alert { border-color: var(--warning); }
.stat-card__n { display: block; font-size: 28px; font-weight: 700; color: var(--brand-primary); }
.stat-card__l { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.rank { margin: 0; padding-left: 20px; }
.rank li { padding: 4px 0; }
.tag--active { background: var(--brand-primary); color: #fff; }
a.tag { text-decoration: none; }
.admin-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; border-top: 1px solid var(--border-default); padding-top: 12px; }
.admin-actions__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form .form-input { flex: 1; min-width: 120px; }
.adm-list { list-style: none; max-height: 320px; overflow-y: auto; }
.adm-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border-default); font-size: 14px; }
.adm-list li.is-off { opacity: .5; }
.adm-list li:last-child { border-bottom: none; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .landing-title { font-size: 32px; }
  .landing-sub { font-size: 16px; }
  .auth-card { padding: 28px 22px; }
  .app-main { padding: 20px 16px; }
  .panel-hero--row { flex-direction: column; align-items: stretch; }
  .radio-cards { grid-template-columns: 1fr; }
  .msg { max-width: 88%; }
  .inline-form { flex-direction: column; }
}
