/*
 * CPT Cursos — Public Styles
 * Áreas: checkout, login/cadastro, área do aluno, player de aula.
 * Classes prefixadas com .cptc- para evitar colisão com o tema.
 * ============================================================ */

/* ── Containers ──────────────────────────────────────────────── */
.cptc-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 16px;
}
.cptc-container--narrow { max-width: 720px; }
.cptc-container--wide   { max-width: 1100px; }

/* ── Botões ──────────────────────────────────────────────────── */
.cptc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
}
.cptc-btn:active { transform: scale(.98); }
.cptc-btn--primary { background: #2271b1; color: #fff; border-color: #2271b1; }
.cptc-btn--primary:hover { background: #135e96; border-color: #135e96; color: #fff; }
.cptc-btn--outline { background: transparent; color: #2271b1; border-color: #2271b1; }
.cptc-btn--outline:hover { background: #2271b1; color: #fff; }
.cptc-btn--block { width: 100%; }
.cptc-btn--sm    { padding: 8px 16px; font-size: 0.85rem; }
.cptc-btn[disabled] { opacity: .5; pointer-events: none; }

.cptc-btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.cptc-back-link {
    display: inline-block;
    font-size: 0.9rem;
    color: #2271b1;
    text-decoration: none;
    margin-bottom: 12px;
}
.cptc-back-link:hover { text-decoration: underline; }

/* ── Alertas ─────────────────────────────────────────────────── */
.cptc-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.cptc-alert p { margin: 6px 0 0; }
.cptc-alert p:last-child { margin-bottom: 0; }
.cptc-alert--info    { background: #eff6ff; color: #1e3a8a; border-left: 4px solid #2271b1; }
.cptc-alert--success { background: #f0fdf4; color: #14532d; border-left: 4px solid #16a34a; }
.cptc-alert--warning { background: #fffbeb; color: #78350f; border-left: 4px solid #f0b429; }
.cptc-alert--error   { background: #fef2f2; color: #7f1d1d; border-left: 4px solid #d63638; }
.cptc-alert--compact { padding: 10px 14px; font-size: 0.85rem; }

/* ── Formulários ─────────────────────────────────────────────── */
.cptc-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cptc-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cptc-form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.cptc-form-field input[type="text"],
.cptc-form-field input[type="email"],
.cptc-form-field input[type="tel"],
.cptc-form-field input[type="password"],
.cptc-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.cptc-form-field input:focus,
.cptc-form-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, .15);
}

.cptc-form-field--checkbox label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 400;
    cursor: pointer;
}
.cptc-form-field--checkbox input { margin-top: 3px; flex-shrink: 0; }
.cptc-form-hint { font-size: 0.8rem; color: #6b7280; margin: 0; }

.cptc-honeypot {
    position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

/* ── Auth (login, cadastro, recuperar) ───────────────────────── */
.cptc-auth-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: #f5f5f7;
}

.cptc-auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.cptc-auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111827;
}

.cptc-auth-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 24px;
}

.cptc-auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
}
.cptc-auth-links a { color: #2271b1; text-decoration: none; }
.cptc-auth-links a:hover { text-decoration: underline; }
.cptc-auth-links span { margin: 0 6px; }

/* ── Checkout ────────────────────────────────────────────────── */
.cptc-checkout-page { padding: 32px 0; background: #f5f5f7; }
.cptc-checkout-page h1 { margin: 0 0 24px; font-size: 1.8rem; }

.cptc-checkout-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: flex-start;
}

.cptc-checkout__summary,
.cptc-checkout__form-wrapper {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.cptc-checkout__summary h3 {
    margin: 0 0 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
}

.cptc-checkout__thumb {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}
.cptc-checkout__thumb img { width: 100%; height: auto; display: block; }

.cptc-checkout__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: #111827;
}

.cptc-checkout__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
    margin: 0;
}

.cptc-checkout__value {
    font-size: 2rem;
    font-weight: 700;
    margin: 4px 0 0;
    color: #111827;
}

.cptc-checkout__value--free { color: #16a34a; font-size: 1.4rem; }

.cptc-checkout__parcela {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.cptc-checkout__notice {
    margin: 16px 0 0;
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
}

/* ── Conta — Lista de Cursos ─────────────────────────────────── */
.cptc-conta-page { padding: 32px 0; background: #f5f5f7; min-height: 70vh; }

.cptc-conta-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.cptc-conta-greeting { margin: 0; font-size: 0.85rem; color: #6b7280; }
.cptc-conta-header h1 { margin: 4px 0 0; font-size: 1.7rem; color: #111827; }

.cptc-conta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.cptc-curso-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
}

.cptc-curso-card__thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f3f4f6;
}
.cptc-curso-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.cptc-curso-card__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.cptc-curso-card__title { margin: 0; font-size: 1.05rem; color: #111827; font-weight: 600; line-height: 1.3; }
.cptc-curso-card__meta { margin: 0; font-size: 0.85rem; color: #6b7280; }
.cptc-curso-card__progress { margin: 0; font-size: 0.8rem; color: #4b5563; }
.cptc-curso-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.cptc-curso-card__actions .cptc-btn { padding: 8px 16px; font-size: 0.85rem; flex: 1; }

/* ── Barra de progresso ──────────────────────────────────────── */
.cptc-progress {
    width: 100%;
    height: 8px;
    background: #f0f0f1;
    border-radius: 999px;
    overflow: hidden;
}
.cptc-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width .3s ease;
}
.cptc-progress--large { height: 12px; margin: 16px 0 8px; }
.cptc-progress--inline { display: inline-block; width: 200px; vertical-align: middle; }
.cptc-progress__label { font-size: 0.85rem; color: #4b5563; margin: 0 0 16px; }
.cptc-progress__inline-label { font-size: 0.85rem; color: #4b5563; margin-left: 8px; }

/* ── Empty state ─────────────────────────────────────────────── */
.cptc-empty-state {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border-radius: 12px;
}
.cptc-empty-state p { font-size: 1.1rem; margin: 0 0 16px; color: #6b7280; }

/* ── Sumário do Curso (módulos) ──────────────────────────────── */
.cptc-curso-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0;
}
.cptc-curso-detail__header h1 { margin: 0; font-size: 1.8rem; color: #111827; }
.cptc-curso-detail__meta { margin: 6px 0 0; font-size: 0.9rem; color: #6b7280; }

.cptc-modulos { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }

.cptc-modulo {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.cptc-modulo__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #f0f0f1;
}

.cptc-modulo__titulo {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cptc-modulo__num {
    display: inline-block;
    background: #e5e7eb;
    color: #4b5563;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
}

.cptc-modulo__progress {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.cptc-aulas {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cptc-aulas .cptc-aula { border-bottom: 1px solid #f0f0f1; }
.cptc-aulas .cptc-aula:last-child { border-bottom: 0; }

.cptc-aulas .cptc-aula a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #1f2937;
    text-decoration: none;
    transition: background .15s;
}
.cptc-aulas .cptc-aula a:hover { background: #f9fafb; }
.cptc-aula.is-done a { color: #6b7280; }

.cptc-aula__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f1;
    color: #6b7280;
    font-weight: 700;
    flex-shrink: 0;
}
.cptc-aula.is-done .cptc-aula__check { background: #16a34a; color: #fff; }

.cptc-aula__titulo { flex: 1; font-size: 0.95rem; }
.cptc-aula__duracao { font-size: 0.8rem; color: #9ca3af; }

/* ── Player de Aula ──────────────────────────────────────────── */
.cptc-aula-page { padding: 24px 0 60px; }
.cptc-aula-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cptc-aula-position { font-size: 0.85rem; color: #6b7280; }
.cptc-aula-titulo { margin: 0 0 4px; font-size: 1.6rem; color: #111827; }
.cptc-aula-modulo-ref { margin: 0 0 20px; font-size: 0.85rem; color: #6b7280; }

.cptc-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}
.cptc-video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.cptc-aula-descricao {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 24px;
}

.cptc-aula-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cptc-aula-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cptc-checkout-grid { grid-template-columns: 1fr; }
    .cptc-conta-grid    { grid-template-columns: 1fr; }
    .cptc-aula-page .cptc-progress--inline { width: 100%; }
}
