/* ============================================================
   Course Free Trial — Frontend Styles
   ============================================================ */

/* ── RESET / BASE ─────────────────────────────────────────── */
.cft-page-wrap *,
.cft-page-wrap *::before,
.cft-page-wrap *::after { box-sizing: border-box; }

/* ── PAGE WRAPPER ─────────────────────────────────────────── */
.cft-page-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 16px 48px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── HERO ─────────────────────────────────────────────────── */
.cft-hero {
    text-align: center;
    padding: 48px 24px 36px;
}
.cft-hero-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.cft-hero-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px;
    line-height: 1.2;
}
.cft-hero-sub {
    font-size: 17px;
    color: #475569;
    margin: 0;
}

/* ── CARDS ─────────────────────────────────────────────────── */
.cft-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.cft-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.cft-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #1e88e5;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

/* ── FORM FIELDS ──────────────────────────────────────────── */
.cft-fields { display: flex; flex-direction: column; gap: 18px; }
.cft-field-row { display: flex; gap: 14px; }
.cft-field-row .cft-field { flex: 1; }
.cft-field { display: flex; flex-direction: column; gap: 6px; }
.cft-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: .2px;
}
.cft-req { color: #ef4444; }
.cft-field input[type="text"],
.cft-field input[type="email"],
.cft-field input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.cft-field input:focus {
    border-color: #1e88e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30,136,229,.14);
}

/* Password toggle */
.cft-pw-wrap { position: relative; display: flex; }
.cft-pw-wrap input { flex: 1; padding-right: 42px; }
.cft-pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    opacity: .6;
    transition: opacity .15s;
}
.cft-pw-toggle:hover { opacity: 1; }

/* Checkbox row */
.cft-field-check { flex-direction: row; align-items: center; gap: 8px; }
.cft-field-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    font-weight: 400;
}
.cft-field-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1e88e5;
    cursor: pointer;
    flex-shrink: 0;
}
.cft-field-check a { color: #1e88e5; text-decoration: underline; }

/* ── COURSE GRID ──────────────────────────────────────────── */
.cft-course-pick-hint {
    font-size: 14px;
    color: #64748b;
    margin: -10px 0 18px;
}
.cft-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.cft-course-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    position: relative;
}
.cft-course-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 16px rgba(30,136,229,.12);
    transform: translateY(-2px);
}
.cft-course-card.cft-selected {
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30,136,229,.18), 0 4px 16px rgba(30,136,229,.1);
}

/* Card image */
.cft-course-card-img {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #e8f0fe;
}

.cft-course-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    display: block;
    transition: transform .3s;
    background: #ffffff;
}
.cft-course-card:hover .cft-course-card-img img { transform: scale(1.04); }
.cft-course-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
}

/* Selected overlay */
.cft-course-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30,136,229,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}
.cft-course-card.cft-selected .cft-course-card-overlay { opacity: 1; }
.cft-selected-label {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .3px;
    background: rgba(0,0,0,.2);
    padding: 6px 16px;
    border-radius: 20px;
}

/* Card body */
.cft-course-card-body { padding: 14px 16px 16px; }
.cft-course-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    border-top: 1px solid;
    padding-top: 10px;
}
.cft-course-card-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cft-course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cft-free-badge {
    font-size: 11px;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
    white-space: nowrap;
}
.cft-select-pill {
    font-size: 11px;
    font-weight: 700;
    color: #1e88e5;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 10px;
    border-radius: 20px;
    transition: background .15s, color .15s;
}
.cft-course-card.cft-selected .cft-select-pill {
    background: #1e88e5;
    color: #fff;
    border-color: #1e88e5;
}
.cft-course-card.cft-selected .cft-select-pill::before { content: '✓ '; }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.cft-empty-notice {
    text-align: center;
    padding: 32px 16px;
    color: #64748b;
}
.cft-empty-icon { font-size: 36px; display: block; margin-bottom: 10px; }

/* ── SUBMIT AREA ──────────────────────────────────────────── */
.cft-submit-area { text-align: center; padding: 8px 0 0; }
.cft-btn-submit {
    display: inline-block;
    width: 100%;
    max-width: 420px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(30,136,229,.35);
}
.cft-btn-submit:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30,136,229,.45);
}
.cft-btn-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}
.cft-submit-note {
    font-size: 13px;
    color: #94a3b8;
    margin: 12px 0 0;
}

/* ── FORM MESSAGES ────────────────────────────────────────── */
.cft-form-message {
    padding: 13px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    display: none;
}
.cft-form-message.cft-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.cft-form-message.cft-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── TRIAL BANNER ─────────────────────────────────────────── */
.cft-trial-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff8e1;
    border: 1px solid #fdd835;
    border-left: 5px solid #fdd835;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 15px;
    flex-wrap: wrap;
}
.cft-trial-banner.cft-banner-urgent {
    background: #fff3f3;
    border-color: #e53935;
    border-left-color: #e53935;
}
.cft-banner-icon { font-size: 22px; flex-shrink: 0; }
.cft-banner-text { flex: 1; line-height: 1.5; }
.cft-banner-text strong { display: block; margin-bottom: 2px; }
.cft-banner-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #1e88e5;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background .2s;
}
.cft-banner-btn:hover { background: #1565c0; }
.cft-banner-urgent .cft-banner-btn { background: #e53935; }
.cft-banner-urgent .cft-banner-btn:hover { background: #b71c1c; }

/* ── COURSE PAGE TRIAL CTA ────────────────────────────────── */
.cft-trial-cta {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.cft-trial-cta p { font-size: 16px; margin-bottom: 12px; color: #0c4a6e; }
.cft-trial-note { display: block; font-size: 13px; color: #64748b; margin-top: 8px; }
.cft-btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: #1e88e5;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s;
}
.cft-btn-primary:hover { background: #1565c0; transform: translateY(-1px); }
.cft-btn-primary:disabled { background: #90caf9; cursor: not-allowed; }

/* ── MY TRIALS ────────────────────────────────────────────── */
.cft-btn-sm {
    display: inline-block;
    padding: 6px 14px;
    background: #1e88e5;
    color: #fff !important;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
}
.cft-btn-sm:hover { background: #1565c0; }
.cft-my-trials h3 { font-size: 20px; margin-bottom: 16px; }
.cft-trials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.cft-trial-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s;
}
.cft-trial-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.cft-trial-thumb { width: 100%; height: 160px; object-fit: cover; }
.cft-trial-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cft-trial-info h4 { margin: 0; font-size: 16px; }
.cft-trial-info h4 a { color: #1a1a2e; text-decoration: none; }
.cft-trial-info h4 a:hover { color: #1e88e5; }
.cft-remaining { font-weight: 700; color: #0e7490; font-size: 14px; }
.cft-dates { font-size: 12px; color: #888; }
.cft-trial-expired .cft-trial-info { opacity: .8; }
.cft-notice { padding: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 15px; }

/* ── BADGES ───────────────────────────────────────────────── */
.cft-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cft-badge-active    { background: #d1fae5; color: #065f46; }
.cft-badge-expired   { background: #fee2e2; color: #991b1b; }
.cft-badge-converted { background: #ede9fe; color: #5b21b6; }
.cft-badge-revoked   { background: #fef3c7; color: #92400e; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .cft-hero-title { font-size: 24px; }
    .cft-card { padding: 20px 18px; }
    .cft-field-row { flex-direction: column; gap: 18px; }
    .cft-course-grid { grid-template-columns: 1fr; }
    .cft-trial-banner { flex-direction: column; align-items: flex-start; }
}

