/* ===========================================================
   DedicaQR — Sprint 5 CSS
   Wizard multi-step, Analytics dashboards, Video player
   =========================================================== */

/* -----------------------------------------------------------------
   WIZARD
   ----------------------------------------------------------------- */
.wizard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}
.wizard-head {
    text-align: center;
    margin-bottom: 1.5rem;
}
.wizard-head h1 {
    font-family: 'Playfair Display', serif;
    color: #C9184A;
    font-size: 1.8rem;
    margin: 0 0 0.5rem;
}
.wizard-sub {
    color: #6c757d;
    margin: 0;
    font-size: 0.95rem;
}

.wizard-progress {
    margin-bottom: 2rem;
}
.wizard-progress__bar {
    width: 100%;
    height: 6px;
    background: #f1d6e0;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.wizard-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #C9184A, #D4A24C);
    transition: width 0.35s ease;
}
.wizard-progress__steps {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.4rem;
    justify-content: space-between;
    flex-wrap: wrap;
}
.wizard-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.78rem;
    flex: 1 0 0;
    min-width: 50px;
    color: #adb5bd;
}
.wizard-progress__step.is-active { color: #C9184A; font-weight: 600; }
.wizard-progress__step.is-done   { color: #28a745; }
.wizard-progress__num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #f1d6e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.35rem;
    font-weight: 700;
}
.wizard-progress__step.is-active .wizard-progress__num { background: #C9184A; color: #fff; }
.wizard-progress__step.is-done   .wizard-progress__num { background: #28a745; color: #fff; }

.wizard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 768px) {
    .wizard-grid { grid-template-columns: 1fr; }
    .wizard-preview { order: -1; position: static; }
}

.wizard-form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.wizard-field {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem;
}
.wizard-field legend {
    font-weight: 700;
    color: #C9184A;
    margin-bottom: 0.75rem;
    padding: 0;
    font-size: 1.05rem;
}
.wizard-field.is-locked { opacity: 0.55; }
.wizard-lock-tag {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.wizard-input {
    display: block;
    margin-bottom: 1rem;
}
.wizard-input > span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #444;
}
.wizard-input input,
.wizard-input select,
.wizard-input textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font: inherit;
}
.wizard-input input:focus,
.wizard-input textarea:focus,
.wizard-input select:focus {
    outline: none;
    border-color: #C9184A;
    box-shadow: 0 0 0 3px rgba(201, 24, 74, 0.15);
}
.wizard-input textarea { min-height: 160px; resize: vertical; }
.wizard-input textarea.is-near-max { border-color: #d4a24c; background: #fffbf0; }
.wizard-char-count {
    float: right;
    font-weight: normal;
    color: #888;
    font-size: 0.85rem;
}
.wizard-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) {
    .wizard-field-row { grid-template-columns: 1fr; }
}

.wizard-cat-grid,
.wizard-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.wizard-cat-card,
.wizard-tpl-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    background: #fff;
    transition: all 0.18s;
    position: relative;
}
.wizard-cat-card:hover,
.wizard-tpl-card:hover { border-color: #FFB3C1; transform: translateY(-2px); }
.wizard-cat-card input,
.wizard-tpl-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wizard-cat-card input:checked + .wizard-cat-card__icon,
.wizard-cat-card:has(input:checked),
.wizard-tpl-card:has(input:checked) {
    border-color: #C9184A;
    box-shadow: 0 0 0 3px rgba(201, 24, 74, 0.15);
}
.wizard-cat-card__icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.wizard-cat-card__label { font-size: 0.85rem; font-weight: 600; }
.wizard-tpl-card__swatch {
    width: 100%;
    height: 70px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #C9184A, #FFB3C1);
}
.wizard-tpl-card__label { font-size: 0.85rem; font-weight: 600; }
.wizard-tpl-card__badge {
    display: inline-block;
    background: #D4A24C;
    color: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 100px;
    font-size: 0.65rem;
    margin-left: 0.25rem;
}
.wizard-tpl-card.is-locked { opacity: 0.55; cursor: not-allowed; }
.wizard-tpl-card__locked {
    font-size: 0.7rem;
    color: #856404;
    background: #fff3cd;
    padding: 0.15rem 0.4rem;
    border-radius: 100px;
    margin-top: 0.4rem;
}

.wizard-radio-card {
    display: block;
    padding: 0.85rem 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    margin-bottom: 0.6rem;
    cursor: pointer;
}
.wizard-radio-card:hover { border-color: #FFB3C1; }
.wizard-radio-card:has(input:checked) { border-color: #C9184A; background: #fff7fa; }
.wizard-radio-card.is-locked { opacity: 0.55; cursor: not-allowed; }
.wizard-radio-card input { margin-right: 0.5rem; }

.wizard-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    cursor: pointer;
    user-select: none;
}
.wizard-toggle--big { font-size: 1.05rem; padding: 1rem; background: #fff7fa; border-radius: 8px; }

.wizard-music-mood {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.05em;
}
.wizard-music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
}
.wizard-music-card {
    display: block;
    padding: 0.75rem;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}
.wizard-music-card:hover { border-color: #FFB3C1; }
.wizard-music-card:has(input:checked) { border-color: #C9184A; background: #fff7fa; }
.wizard-music-card input { margin-right: 0.4rem; }
.wizard-music-card__title { display: block; font-weight: 600; font-size: 0.92rem; }
.wizard-music-card__artist { display: block; font-size: 0.8rem; color: #888; margin-bottom: 0.4rem; }
.wizard-music-card__player { width: 100%; height: 30px; }

.wizard-locked-banner {
    padding: 1rem;
    background: #fff3cd;
    color: #856404;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.wizard-locked-banner a { color: #C9184A; font-weight: 600; }

.wizard-qr-demo {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}
.wizard-qr-demo__sample { text-align: center; }
.wizard-qr-demo__mock {
    width: 180px; height: 180px;
    background: repeating-conic-gradient(#000 0% 25%, #fff 0% 50%);
    background-size: 14px 14px;
    border: 4px solid #fff;
    margin: 0 auto 0.4rem;
    position: relative;
}
.wizard-qr-demo__logo {
    position: absolute;
    width: 40px; height: 40px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #C9184A;
    box-shadow: 0 0 0 3px #fff;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0e6ea;
}

.wizard-summary {
    background: #fff7fa;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.wizard-summary__list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin: 0;
}
.wizard-summary__list dt { font-weight: 700; color: #6c757d; font-size: 0.9rem; }
.wizard-summary__list dd { margin: 0; color: #333; font-size: 0.9rem; word-break: break-word; }
.wizard-finalize-note {
    padding: 1rem;
    background: #e7f3ff;
    border-radius: 8px;
    color: #004085;
    font-size: 0.9rem;
}

/* Preview panel */
.wizard-preview {
    position: sticky;
    top: 1rem;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    border: 2px dashed #FFB3C1;
}
.wizard-preview__header {
    text-align: center;
    margin-bottom: 1rem;
}
.wizard-preview__chip {
    display: inline-block;
    background: #FFB3C1;
    color: #C9184A;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
}
.wizard-preview__card {
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #FFF8F5 0%, #fff 100%);
    border-radius: 10px;
}
.wizard-preview__to { font-size: 0.9rem; color: #888; margin: 0 0 0.5rem; }
.wizard-preview__title {
    font-family: 'Playfair Display', serif;
    color: #C9184A;
    font-size: 1.4rem;
    margin: 0 0 1rem;
}
.wizard-preview__message {
    color: #555;
    line-height: 1.6;
    margin: 0 0 1rem;
    text-align: left;
}
.wizard-preview__message--empty { text-align: center; color: #aaa; }
.wizard-preview__signature {
    font-style: italic;
    color: #888;
    margin: 0;
}
.wizard-preview__meta {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* -----------------------------------------------------------------
   ANALYTICS DASHBOARDS
   ----------------------------------------------------------------- */
.user-range-form,
.adm-range-form {
    margin: 0;
}
.user-range-form select,
.adm-range-form select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.analytics-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: left;
}
.analytics-stat-card__icon { font-size: 1.6rem; margin-bottom: 0.3rem; }
.analytics-stat-card__value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #C9184A;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.analytics-stat-card__label { font-size: 0.85rem; color: #6c757d; }

.analytics-chart-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}
.analytics-chart-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: #444;
}

.analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
    .analytics-row { grid-template-columns: 1fr; }
}

.analytics-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}
.analytics-card h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #444;
}
.analytics-empty {
    color: #888;
    font-style: italic;
    margin: 0.5rem 0;
}

.analytics-bars {
    list-style: none;
    padding: 0;
    margin: 0;
}
.analytics-bars li {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: 0.6rem;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f7f0f3;
}
.analytics-bars__label { font-weight: 600; color: #444; font-size: 0.9rem; }
.analytics-bars__bar {
    background: #f1d6e0;
    height: 12px;
    border-radius: 100px;
    overflow: hidden;
}
.analytics-bars__bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #C9184A, #D4A24C);
    border-radius: 100px;
}
.analytics-bars__count {
    text-align: right;
    font-weight: 600;
    color: #C9184A;
    font-size: 0.9rem;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}
.analytics-table th,
.analytics-table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9rem;
}
.analytics-table th {
    color: #6c757d;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.analytics-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.analytics-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f7f0f3;
}
.analytics-list__label { color: #444; word-break: break-all; }
.analytics-list__count { font-weight: 700; color: #C9184A; }

/* -----------------------------------------------------------------
   VIDEO PLAYER
   ----------------------------------------------------------------- */
.ded-video-player {
    margin: 1.5rem auto;
    max-width: 600px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    background: #000;
}
.ded-video-player__video {
    width: 100%;
    height: auto;
    display: block;
}
.ded-video-player__caption {
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.85rem;
    text-align: center;
}

/* Adaptaciones por template */
.tpl-elegant-gold .ded-video-player { box-shadow: 0 6px 24px rgba(212, 162, 76, 0.3); }
.tpl-minimal-white .ded-video-player { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border: 1px solid #eee; }

/* -----------------------------------------------------------------
   USER section header con acciones
   ----------------------------------------------------------------- */
.user-section-header__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* -----------------------------------------------------------------
   ADMIN forms (qr config)
   ----------------------------------------------------------------- */
.adm-form { max-width: 720px; }
.adm-fieldset {
    border: 1px solid #e9ecef;
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.adm-fieldset legend {
    font-weight: 700;
    color: #C9184A;
    padding: 0 0.5rem;
}
.adm-input {
    display: block;
    margin-bottom: 1rem;
}
.adm-input > span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.adm-input input,
.adm-input select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.adm-input input[type="color"] { height: 40px; padding: 2px; cursor: pointer; }
.adm-input input[type="range"] { padding: 0; }
.adm-input small { display: block; color: #888; margin-top: 0.25rem; }
.adm-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.75rem;
}
.adm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.adm-page-sub { color: #6c757d; font-size: 0.9rem; max-width: 720px; }
