/* Pictore Studio — Artigos (interface do cliente) */

/* ------------------------------------------------------------ Progresso */
.psa-progress-card {
	background: #fff;
	border: 1px solid var(--psc-hairline, #e5e7eb);
	border-radius: var(--psc-radius, 18px);
	padding: 20px 22px;
	margin-bottom: 22px;
	box-shadow: var(--psc-shadow-sm, 0 1px 3px rgba(17, 24, 39, .06));
}
.psa-progress-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}
.psa-progress-label strong { font-size: 16px; }
.psa-progress-label span { color: var(--psc-ink-soft); font-size: 13px; }
.psa-progress-track {
	height: 12px;
	border-radius: 999px;
	background: #eef0f3;
	overflow: hidden;
}
.psa-progress-fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, #8b5cf6, #6d28d9);
	transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.psa-progress-fill.psa-complete { background: linear-gradient(90deg, #34d399, #059669); }

/* -------------------------------------------------------- Grade de artigos */
.psa-client-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}
@media (max-width: 600px) { .psa-client-grid { grid-template-columns: 1fr; } }

.psa-client-card {
	background: #fff;
	border: 1px solid var(--psc-hairline, #e5e7eb);
	border-radius: var(--psc-radius, 18px);
	overflow: hidden;
	cursor: pointer;
	box-shadow: var(--psc-shadow-sm, 0 1px 3px rgba(17, 24, 39, .06));
	transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease, border-color .2s ease;
	text-align: left;
	padding: 0;
	font-family: inherit;
	display: flex;
	flex-direction: column;
}
.psa-client-card:hover {
	box-shadow: var(--psc-shadow-md, 0 12px 30px rgba(17, 24, 39, .12)), var(--psc-glow, none);
	transform: translateY(-3px);
	border-color: rgba(109, 40, 217, .28);
}
.psa-client-card.psa-st-waiting { border-color: #f59e0b; box-shadow: 0 0 0 1.5px #f59e0b; }
.psa-client-card.psa-st-denied { border-color: #dc2626; box-shadow: 0 0 0 1.5px #dc2626; }
.psa-client-card.psa-st-approved { border-color: #059669; }

/* Faixa de status em destaque no topo do card */
.psa-status-ribbon {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 8px 10px;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #fff;
	box-sizing: border-box;
}
.psa-rb-waiting { background: #f59e0b; }
.psa-rb-waiting .psc-pulse { background: #fff; }
.psa-rb-denied { background: #dc2626; }
.psa-rb-approved { background: #059669; }

.psa-client-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: #111;
	overflow: hidden;
}
.psa-client-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.psa-client-card-body { padding: 12px 14px 14px; display: block; }
.psa-client-card-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--psc-ink);
}
.psa-client-card-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--psc-ink-soft);
}
.psa-client-card-date { display: block; margin-top: 8px; font-size: 12px; color: var(--psc-ink-soft); }
.psa-client-decided { display: block; margin-top: 5px; font-size: 11.5px; color: var(--psc-ink-soft); }

/* ----------------------------------------- Leitor do artigo (viewer) */
.psa-viewer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .7);
	backdrop-filter: blur(3px);
	z-index: 200;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 20px 14px;
	overflow-y: auto;
}
.psa-viewer-overlay[hidden] { display: none; }

/* A leitura do texto é o centro da aprovação: a caixa é larga e alta. */
.psa-viewer-box {
	width: 100%;
	max-width: 800px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	border-radius: 18px;
	animation: psc-rise .2s ease;
	position: relative;
}
.psa-viewer-close {
	position: sticky;
	/* top igual à margem para o botão manter o mesmo respiro ao grudar no topo. */
	top: 10px;
	margin-left: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 24, 39, .75);
	color: #fff;
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
	z-index: 5;
	float: right;
	margin: 10px 10px 0 0;
}

/* Estado de carregamento: o modal já está na tela enquanto a permissão do
   pacote é revalidada no servidor. */
.psa-viewer-loading {
	min-height: 55vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 40px 20px;
	color: var(--psc-ink-soft);
	font-size: 14px;
	clear: both;
}
.psa-loading-spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid rgba(109, 40, 217, .18);
	border-top-color: var(--psc-primary);
	animation: psc-spin .7s linear infinite;
}
.psa-viewer-loading p { margin: 0; }

/* Emulação do post publicado no WordPress */
.psa-post {
	font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
	color: #1f2328;
	max-width: 680px;
	margin: 0 auto;
	padding: 20px 32px 8px;
	clear: both;
}
.psa-post-head { text-align: center; margin-bottom: 22px; }
.psa-post-blog {
	display: block;
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--psc-primary);
	margin-bottom: 10px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.psa-post-title {
	margin: 0 0 12px;
	font-size: 32px;
	line-height: 1.2;
	font-weight: 700;
	color: #111827;
}
.psa-post-meta {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	color: #6b7280;
}
.psa-post-figure { margin: 0 0 26px; }
.psa-post-figure img { width: 100%; height: auto; display: block; border-radius: 6px; }
/* Cada elemento declara o próprio tamanho (e não só herda do container) para
   ficar idêntico ao preview do admin, onde o CSS do wp-admin estiliza p/li. */
.psa-post-content { font-size: 18px; line-height: 1.75; }
.psa-post-content p { font-size: 18px; line-height: 1.75; margin: 0 0 1.35em; }
.psa-post-content li { font-size: 18px; line-height: 1.75; }
.psa-post-content > :first-child { margin-top: 0; }
.psa-post-content h2 { font-size: 26px; line-height: 1.25; margin: 1.5em 0 .5em; font-weight: 700; color: #111827; }
.psa-post-content h3 { font-size: 21px; line-height: 1.3; margin: 1.4em 0 .5em; font-weight: 700; color: #111827; }
.psa-post-content ul, .psa-post-content ol { margin: 0 0 1.35em; padding-left: 1.5em; }
.psa-post-content ul { list-style: disc; }
.psa-post-content ol { list-style: decimal; }
.psa-post-content li { margin-bottom: .4em; }
.psa-post-content blockquote {
	margin: 0 0 1.35em;
	padding: 4px 0 4px 18px;
	border-left: 3px solid var(--psc-primary);
	color: #4b5563;
	font-style: italic;
}
.psa-post-content a { color: var(--psc-primary); }

@media (max-width: 600px) {
	.psa-post { padding: 16px 18px 8px; }
	.psa-post-title { font-size: 25px; }
	.psa-post-content,
	.psa-post-content p,
	.psa-post-content li { font-size: 16.5px; }
	.psa-post-content h2 { font-size: 23px; }
	.psa-post-content h3 { font-size: 19.5px; }
}

/* Área de decisão abaixo do artigo */
.psa-decision {
	border-top: 1px solid var(--psc-line);
	padding: 18px 24px 24px;
	position: sticky;
	bottom: 0;
	background: #fff;
}
.psa-decision-approved {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #d1fae5;
	color: #065f46;
	border-radius: 10px;
	padding: 12px 14px;
	font-weight: 600;
	font-size: 14px;
}
.psa-decision-denied {
	background: var(--psc-danger-soft);
	color: #7f1d1d;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13.5px;
	margin-bottom: 12px;
}
.psa-decision-denied strong { display: block; margin-bottom: 4px; }
.psa-decision-buttons { display: flex; gap: 10px; }
.psa-btn-approve {
	flex: 1;
	background: var(--psc-success);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 13px 16px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background .15s ease, transform .05s ease;
}
.psa-btn-approve:hover { background: #047857; }
.psa-btn-approve:active { transform: translateY(1px); }
.psa-btn-reject {
	flex: 1;
	background: #fff;
	color: var(--psc-danger);
	border: 1.5px solid #fecaca;
	border-radius: 10px;
	padding: 13px 16px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: all .15s ease;
}
.psa-btn-reject:hover { background: var(--psc-danger); color: #fff; border-color: var(--psc-danger); }
.psa-decision-note { margin: 10px 0 0; font-size: 12px; color: var(--psc-ink-soft); text-align: center; }

/* Formulário de reprovação */
.psa-reject-form textarea {
	width: 100%;
	border: 1px solid var(--psc-line);
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.5;
	min-height: 110px;
	resize: vertical;
	box-sizing: border-box;
}
.psa-reject-form textarea:focus { border-color: var(--psc-danger); box-shadow: 0 0 0 3px var(--psc-danger-soft); outline: none; }
.psa-reject-form .psa-reject-hint { font-size: 12.5px; color: var(--psc-ink-soft); margin: 0 0 8px; }
.psa-reject-error { color: var(--psc-danger); font-size: 13px; font-weight: 600; margin: 8px 0 0; }
.psa-reject-actions { display: flex; gap: 10px; margin-top: 12px; }
.psa-reject-actions .psa-btn-cancel {
	flex: 1;
	background: #fff;
	border: 1px solid var(--psc-line);
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}
.psa-reject-actions .psa-btn-confirm {
	flex: 1;
	background: var(--psc-danger);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}
.psa-reject-actions .psa-btn-confirm:disabled { opacity: .6; }

/* -------------------------------------------- Countdown de aprovação */
.psa-countdown-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .82);
	z-index: 300;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	color: #fff;
	text-align: center;
	padding: 20px;
}
.psa-countdown-overlay[hidden] { display: none; }
.psa-countdown-number {
	width: 110px;
	height: 110px;
	border-radius: 50%;
	border: 4px solid #34d399;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 52px;
	font-weight: 800;
	animation: psa-tick 1s ease infinite;
}
@keyframes psa-tick {
	0% { transform: scale(1); opacity: 1; }
	85% { transform: scale(1.12); opacity: .9; }
	100% { transform: scale(1); opacity: 1; }
}
.psa-countdown-overlay h2 { margin: 0; font-size: 21px; }
.psa-countdown-overlay p { margin: 0; color: #d1d5db; font-size: 14px; }
.psa-countdown-cancel {
	margin-top: 6px;
	background: #fff;
	color: #111827;
	border: 0;
	border-radius: 999px;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}
.psa-countdown-cancel:hover { background: #f3f4f6; }

/* ------------------------------------------------ Animações de sucesso */
.psa-success-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .82);
	z-index: 310;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	color: #fff;
	text-align: center;
	padding: 20px;
	overflow: hidden;
}
.psa-success-overlay[hidden] { display: none; }

.psa-success-check {
	width: 110px;
	height: 110px;
	border-radius: 50%;
	background: #059669;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: psa-pop-check .45s cubic-bezier(.18, .89, .32, 1.28);
	box-shadow: 0 0 0 12px rgba(5, 150, 105, .25);
}
.psa-success-check svg { width: 56px; height: 56px; }
.psa-success-check path {
	stroke: #fff;
	stroke-width: 3.4;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: psa-draw .45s .25s ease forwards;
}
@keyframes psa-pop-check { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes psa-draw { to { stroke-dashoffset: 0; } }

.psa-success-overlay h2 { margin: 6px 0 0; font-size: 24px; animation: psc-rise .4s .2s ease backwards; }
.psa-success-overlay p { margin: 0; color: #d1d5db; font-size: 15px; animation: psc-rise .4s .3s ease backwards; }
.psa-success-btn {
	margin-top: 14px;
	background: #fff;
	color: #111827;
	border: 0;
	border-radius: 999px;
	padding: 13px 32px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	animation: psc-rise .4s .4s ease backwards;
}

.psa-confetti {
	position: absolute;
	top: -14px;
	width: 10px;
	height: 16px;
	border-radius: 2px;
	opacity: .95;
	animation: psa-confetti-fall linear forwards;
}
@keyframes psa-confetti-fall {
	0% { transform: translateY(-20px) rotate(0deg); }
	100% { transform: translateY(110vh) rotate(720deg); }
}

/* ------------------------------------------------------- Aviso "fixing" */
.psa-locked-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .75);
	z-index: 320;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.psa-locked-overlay[hidden] { display: none; }
.psa-locked-box {
	background: #fff;
	border-radius: 16px;
	max-width: 380px;
	width: 100%;
	padding: 28px 26px;
	text-align: center;
	animation: psc-rise .2s ease;
}
.psa-locked-box .psa-locked-icon { font-size: 40px; }
.psa-locked-box h2 { margin: 10px 0 8px; font-size: 19px; }
.psa-locked-box p { margin: 0; color: var(--psc-ink-soft); font-size: 14px; }

/* -------------------------------------- Tela de acesso pelo link (chave) */
.psa-key-users { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.psa-key-user {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	background: #fff;
	border: 1.5px solid var(--psc-line);
	border-radius: 12px;
	padding: 13px 16px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	text-align: left;
	transition: all .15s ease;
}
.psa-key-user:hover { border-color: var(--psc-primary); background: #faf9ff; }
.psa-key-user.psa-selected { border-color: var(--psc-primary); background: #ede9fe; }
.psa-key-user .psa-key-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--psc-primary);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	flex-shrink: 0;
}
.psa-key-password[hidden] { display: none; }
