/**
 * Olo Tutor — Template Pagina Singolo Corso
 * Layout dinamico professionale per /corso/xxx/
 */

:root {
	--otc-primary: var(--ot-primary, #4a8c2a);
	--otc-primary-light: var(--ot-primary-50, #f0f7ec);
	--otc-text: #1e293b;
	--otc-text-muted: #64748b;
	--otc-text-light: #94a3b8;
	--otc-border: #e2e8f0;
	--otc-bg: #f8fafc;
	--otc-card: #ffffff;
	--otc-radius: 16px;
	--otc-success: #10b981;
	--otc-warning: #f59e0b;
	--otc-danger: #ef4444;
}

.ot-course-page { max-width: 1200px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.ot-course-page *, .ot-course-page *::before, .ot-course-page *::after { box-sizing: border-box; }

/* ========== HERO ========== */
.ot-cp-hero {
	position: relative; min-height: 380px; border-radius: var(--otc-radius);
	overflow: hidden; margin-bottom: 32px;
	background: linear-gradient(135deg, #4a8c2a 0%, #3d7523 50%, #2a4d19 100%);
	background-size: cover; background-position: center;
}
.ot-cp-hero-overlay {
	position: absolute; inset: 0; display: flex; align-items: flex-end;
	background: linear-gradient(to top, rgba(15,23,42,.85) 0%, rgba(15,23,42,.4) 50%, rgba(15,23,42,.1) 100%);
	padding: 48px 40px;
}
.ot-cp-hero-content { position: relative; z-index: 2; color: #fff; max-width: 700px; }
.ot-cp-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ot-cp-badge {
	display: inline-block; padding: 5px 14px; font-size: 11px; font-weight: 700;
	border-radius: 20px; background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
	text-transform: uppercase; letter-spacing: .06em; color: #fff;
}
.ot-cp-badge--level { background: var(--otc-primary); }
.ot-cp-badge--active { background: rgba(16,185,129,.4); }
.ot-cp-title { font-size: 36px; font-weight: 800; line-height: 1.15; margin: 0 0 14px; color: #fff; }
.ot-cp-excerpt { font-size: 17px; line-height: 1.6; margin: 0 0 20px; opacity: .9; color: #e2e8f0; }
.ot-cp-hero-meta { display: flex; flex-wrap: wrap; gap: 20px; }
.ot-cp-meta-item {
	display: inline-flex; align-items: center; gap: 7px; font-size: 14px;
	font-weight: 500; color: rgba(255,255,255,.85);
}

/* ========== BODY LAYOUT ========== */
.ot-cp-body { display: grid; grid-template-columns: 1fr 340px; gap: 32px; }
.ot-cp-main { min-width: 0; }
.ot-cp-sidebar { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 20px; }

/* ========== INFO CARDS ========== */
.ot-cp-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.ot-cp-info-card {
	background: var(--otc-card); border: 1px solid var(--otc-border); border-radius: 12px;
	padding: 20px; text-align: center; transition: transform .15s, box-shadow .15s;
}
.ot-cp-info-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.ot-cp-info-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--otc-primary); }
.ot-cp-info-label { font-size: 11px; font-weight: 600; color: var(--otc-text-light); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.ot-cp-info-value { font-size: 16px; font-weight: 700; color: var(--otc-text); }

/* ========== SECTIONS ========== */
.ot-cp-section { margin-bottom: 36px; }
.ot-cp-section-title {
	display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700;
	color: var(--otc-text); margin: 0 0 20px; padding-bottom: 14px;
	border-bottom: 2px solid var(--otc-primary-light);
}
.ot-cp-section-title svg { color: var(--otc-primary); flex-shrink: 0; }
.ot-cp-content { font-size: 16px; line-height: 1.75; color: #334155; }
.ot-cp-content p { margin: 0 0 16px; }
.ot-cp-content h2, .ot-cp-content h3 { color: var(--otc-text); margin: 28px 0 12px; }
.ot-cp-content ul, .ot-cp-content ol { margin: 0 0 16px; padding-left: 24px; }
.ot-cp-content li { margin-bottom: 6px; }

/* ========== PROGRAMMA ========== */
.ot-cp-module {
	border: 1px solid var(--otc-border); border-radius: 12px; margin-bottom: 10px;
	overflow: hidden; background: var(--otc-card); transition: box-shadow .15s;
}
.ot-cp-module:hover { box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.ot-cp-module-head {
	width: 100%; display: flex; align-items: center; justify-content: space-between;
	padding: 18px 20px; background: none; border: none; cursor: pointer;
	text-align: left; font-family: inherit; transition: background .12s;
}
.ot-cp-module-head:hover { background: var(--otc-bg); }
.ot-cp-module-left { display: flex; align-items: center; gap: 14px; }
.ot-cp-module-num {
	width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center;
	justify-content: center; background: var(--otc-primary); color: #fff;
	font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.ot-cp-module-title { display: block; font-size: 15px; font-weight: 600; color: var(--otc-text); }
.ot-cp-module-meta { display: block; font-size: 12px; color: var(--otc-text-light); margin-top: 2px; }
.ot-cp-module-chevron { color: var(--otc-text-light); transition: transform .25s; flex-shrink: 0; }
.ot-cp-module.open .ot-cp-module-chevron { transform: rotate(180deg); }
.ot-cp-module-body {
	max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .25s ease;
	padding: 0 20px;
}
.ot-cp-module.open .ot-cp-module-body { max-height: 600px; padding: 4px 20px 18px; }
.ot-cp-lesson {
	display: flex; align-items: center; gap: 12px; padding: 10px 14px;
	border-radius: 8px; font-size: 14px; color: #475569; transition: background .1s;
}
.ot-cp-lesson:hover { background: var(--otc-primary-light); }
.ot-cp-lesson-icon { color: var(--otc-text-light); display: flex; flex-shrink: 0; }

/* ========== SESSIONI ========== */
.ot-cp-sessions { display: flex; flex-direction: column; gap: 10px; }
.ot-cp-session {
	display: flex; align-items: center; gap: 16px; padding: 16px 20px;
	background: var(--otc-card); border: 1px solid var(--otc-border); border-radius: 12px;
	transition: transform .12s, box-shadow .12s;
}
.ot-cp-session:hover { transform: translateX(4px); box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.ot-cp-session-date {
	width: 52px; height: 56px; border-radius: 10px; background: var(--otc-primary-light);
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.ot-cp-session-day { font-size: 22px; font-weight: 800; color: var(--otc-primary); line-height: 1; }
.ot-cp-session-month { font-size: 11px; font-weight: 600; color: var(--otc-primary); text-transform: uppercase; }
.ot-cp-session-info { flex: 1; min-width: 0; }
.ot-cp-session-title { font-size: 15px; font-weight: 600; color: var(--otc-text); }
.ot-cp-session-time { font-size: 13px; color: var(--otc-text-muted); margin-top: 2px; }
.ot-cp-session-type {
	display: inline-block; padding: 2px 10px; font-size: 11px; font-weight: 600;
	border-radius: 12px; margin-top: 4px;
}
.ot-cp-session-type--in-person { background: #dbeafe; color: #1d4ed8; }
.ot-cp-session-type--online { background: #d1fae5; color: #059669; }
.ot-cp-session-type--hybrid { background: #fef3c7; color: #b45309; }
.ot-cp-session-loc { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--otc-text-light); flex-shrink: 0; }

/* ========== SIDEBAR CTA ========== */
.ot-cp-cta-card {
	background: var(--otc-card); border: 1px solid var(--otc-border); border-radius: var(--otc-radius);
	padding: 28px; text-align: center; border-top: 4px solid var(--otc-primary);
	box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.ot-cp-price { font-size: 38px; font-weight: 800; color: var(--otc-text); margin-bottom: 16px; }
.ot-cp-price--free { color: var(--otc-success); font-size: 28px; }
.ot-cp-spots { margin-bottom: 20px; text-align: left; }
.ot-cp-spots-text { display: flex; justify-content: space-between; font-size: 13px; color: var(--otc-text-muted); margin-bottom: 6px; }
.ot-cp-spots-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.ot-cp-spots-fill { height: 100%; border-radius: 3px; background: var(--otc-primary); transition: width .5s ease; }
.ot-cp-cta-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--otc-text-muted); margin-bottom: 12px; text-align: left; }
.ot-cp-cta-info svg { flex-shrink: 0; color: var(--otc-primary); }
.ot-cp-enroll-btn {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; padding: 16px 24px; font-size: 17px; font-weight: 700;
	background: var(--otc-primary); color: #fff; border: none; border-radius: 12px;
	text-decoration: none; cursor: pointer;
	transition: transform .15s, box-shadow .15s;
}
.ot-cp-enroll-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,140,42,.35); color: #fff; }
.ot-cp-guarantee {
	display: flex; align-items: center; justify-content: center; gap: 6px;
	margin-top: 14px; font-size: 12px; color: var(--otc-text-light);
}
.ot-cp-guarantee svg { color: var(--otc-primary); }

/* ========== SIDEBAR CARDS ========== */
.ot-cp-teacher-card, .ot-cp-share-card {
	background: var(--otc-card); border: 1px solid var(--otc-border);
	border-radius: var(--otc-radius); padding: 20px;
}
.ot-cp-sidebar-title { font-size: 14px; font-weight: 700; color: var(--otc-text); margin: 0 0 14px; text-transform: uppercase; letter-spacing: .05em; }
.ot-cp-teacher { display: flex; align-items: center; gap: 14px; }
.ot-cp-teacher-avatar { flex-shrink: 0; }
.ot-cp-teacher-avatar img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.ot-cp-teacher-name { font-size: 15px; font-weight: 600; color: var(--otc-text); }
.ot-cp-teacher-bio { font-size: 13px; color: var(--otc-text-muted); line-height: 1.4; margin-top: 4px; }

/* Condividi */
.ot-cp-share-links { display: flex; gap: 8px; }
.ot-cp-share-btn {
	width: 40px; height: 40px; border-radius: 10px; display: flex;
	align-items: center; justify-content: center; color: #fff;
	text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.ot-cp-share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.ot-cp-share--fb { background: #1877f2; }
.ot-cp-share--tw { background: #1da1f2; }
.ot-cp-share--li { background: #0077b5; }
.ot-cp-share--wa { background: #25d366; }

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
	.ot-cp-body { grid-template-columns: 1fr; }
	.ot-cp-sidebar { position: static; order: -1; }
	.ot-cp-info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.ot-cp-hero { min-height: 300px; }
	.ot-cp-hero-overlay { padding: 24px 20px; }
	.ot-cp-title { font-size: 26px; }
	.ot-cp-excerpt { font-size: 15px; }
	.ot-cp-hero-meta { gap: 12px; }
	.ot-cp-info-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.ot-cp-session { flex-direction: column; align-items: flex-start; gap: 10px; }
}
