/* ============================================
   Cover Letter Builder Page Styles
   Senior UI/UX Review - Refined Spacing & Alignment
   ============================================ */

/* Hero Section */
.cl-hero {
    padding: 10rem 2rem 6rem;
    background: linear-gradient(180deg, #ECFDF5 0%, #F0FDF4 50%, #FFFFFF 100%);
    position: relative;
    overflow: visible;
}

.cl-hero-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.cl-hero-content {
    padding-right: 2rem;
}

.cl-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 1.5rem;
}

.cl-hero-badge .badge-icon {
    font-size: 1rem;
}

.cl-hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.cl-hero-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    line-height: 1.75;
    margin-bottom: 2rem;
    max-width: 500px;
}

.cl-hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.cl-hero-cta .btn {
    padding: 1rem 1.75rem;
    font-size: 1rem;
}

.cl-hero-trust {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trust-avatars {
    display: flex;
}

.trust-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    margin-left: -10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trust-avatar:first-child {
    margin-left: 0;
}

.trust-avatar:nth-child(2) {
    background: linear-gradient(135deg, #10B981, #059669);
}

.trust-avatar:nth-child(3) {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.trust-avatar:nth-child(4) {
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 1rem;
}

.trust-text {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* Hero Visual */
.cl-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.cl-preview-card {
    background: white;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 20px 40px rgba(0, 0, 0, 0.1);
    width: 320px;
    position: relative;
    overflow: visible;
}

.cl-preview-header {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 16px 16px 0 0;
}

.cl-preview-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.cl-preview-dot.red {
    background: #FF5F56;
}

.cl-preview-dot.yellow {
    background: #FFBD2E;
}

.cl-preview-dot.green {
    background: #27C93F;
}

.cl-preview-body {
    padding: 1.5rem;
}

.cl-preview-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.35rem;
}

.cl-preview-contact {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.cl-preview-date {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 1.25rem;
}

.cl-preview-line {
    height: 10px;
    background: linear-gradient(90deg, var(--gray-200), var(--gray-100));
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.cl-preview-line.wide {
    width: 100%;
}

.cl-preview-line.medium {
    width: 80%;
}

.cl-preview-line.short {
    width: 55%;
}

.cl-preview-spacer {
    height: 0.75rem;
}

.cl-preview-signature {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 1rem;
}

.cl-preview-signature-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Floating Badges with proper positioning */
.cl-floating-badge {
    position: absolute;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.cl-floating-badge.score {
    top: 20%;
    right: -50px;
    flex-direction: column;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 1rem 1.25rem;
    animation: float-badge 3s ease-in-out infinite;
}

.cl-floating-badge.score .badge-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.cl-floating-badge.score .badge-label {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cl-floating-badge.ai {
    bottom: 25%;
    left: -30px;
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    color: white;
    padding: 0.625rem 1rem;
    animation: float-badge 3s ease-in-out infinite 0.5s;
}

.cl-floating-badge.ai .badge-icon {
    font-size: 1.125rem;
}

.cl-floating-badge.ai .badge-label {
    font-size: 0.8rem;
    font-weight: 600;
}

@keyframes float-badge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ============================================
   Trust Section
   ============================================ */
.trust-section {
    padding: 3rem 2rem;
    background: white;
    border-bottom: 1px solid var(--gray-100);
}

.trust-section .section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.trust-headline {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trust-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3.5rem;
    flex-wrap: wrap;
}

.trust-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-300);
    letter-spacing: -0.02em;
}

/* ============================================
   Features Section
   ============================================ */
.cl-features {
    padding: 6rem 2rem;
    background: white;
}

.cl-features .section-header {
    max-width: 700px;
    margin: 0 auto 4rem;
    text-align: center;
}

.cl-features .section-tag {
    margin-bottom: 1rem;
}

.cl-features .section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cl-features .section-description {
    font-size: 1.125rem;
    color: var(--gray-600);
}

.cl-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.cl-feature-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.25s ease;
}

.cl-feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.12);
    transform: translateY(-6px);
}

.cl-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    display: block;
}

.cl-feature-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.cl-feature-desc {
    font-size: 0.95rem;
    color: var(--gray-600);
    line-height: 1.65;
}

/* ============================================
   Success Section
   ============================================ */
.cl-success-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
}

.cl-success-section .section-header {
    max-width: 600px;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.cl-success-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.cl-success-card {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.cl-success-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.cl-success-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.3;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.cl-success-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.625rem;
}

.cl-success-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* ============================================
   How It Works - 3 Steps
   ============================================ */
.steps-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ============================================
   Templates Section
   ============================================ */
.cl-templates-section {
    padding: 6rem 2rem;
    background: white;
}

.cl-templates-section .section-header {
    max-width: 600px;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.cl-templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto 3rem;
}

.cl-template-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    transition: all 0.25s ease;
}

.cl-template-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.1);
    transform: translateY(-4px);
}

.cl-template-preview {
    height: 200px;
    background: #FAFBFC;
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
}

/* Template Preview Styles */
.cl-template-preview.professional {
    background: white;
}

.cl-template-preview.professional .tpl-header {
    height: 24px;
    background: var(--gray-200);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.cl-template-preview.professional .tpl-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cl-template-preview.modern {
    background: white;
    padding-left: 0;
}

.cl-template-preview.modern .tpl-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(180deg, var(--primary) 0%, #6366F1 100%);
    border-radius: 12px 0 0 12px;
}

.cl-template-preview.modern .tpl-body {
    margin-left: 65px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 0.5rem;
}

.cl-template-preview.creative {
    background: white;
}

.cl-template-preview.creative .tpl-gradient-header {
    height: 50px;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.cl-template-preview.creative .tpl-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cl-template-preview.minimal {
    background: white;
}

.cl-template-preview.minimal .tpl-body.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
}

.tpl-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tpl-line {
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
}

.tpl-line.wide {
    width: 100%;
}

.tpl-line.medium {
    width: 75%;
}

.tpl-line.short {
    width: 50%;
}

.tpl-divider {
    height: 2px;
    background: var(--gray-300);
    width: 60px;
    margin: 4px 0;
}

.cl-template-info {
    padding: 0.5rem 0 0.75rem;
}

.cl-template-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.cl-template-info p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.btn-outline-sm {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-outline-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
}

.cl-templates-cta {
    text-align: center;
    margin-top: 2rem;
}

/* ============================================
   Examples Section
   ============================================ */
.cl-examples-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, #F9FAFB 0%, #FFFFFF 100%);
}

.cl-examples-section .section-header {
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

.cl-examples-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.cl-example-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cl-example-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.1);
    transform: translateX(4px);
}

.cl-example-card .example-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cl-example-card .example-title {
    flex: 1;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.cl-example-card .example-arrow {
    color: var(--gray-300);
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.cl-example-card:hover .example-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* ============================================
   Final CTA Section
   ============================================ */
.cl-final-cta {
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #1E3A8A 0%, #6366F1 50%, #8B5CF6 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cl-final-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.cl-final-cta .cta-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cl-final-cta .cta-content h2 {
    font-size: 2.75rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.cl-final-cta .cta-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.cl-final-cta .btn-primary {
    background: white;
    color: #4F46E5;
    padding: 1rem 2rem;
    font-size: 1.0625rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.cl-final-cta .btn-primary:hover {
    background: #F8FAFC;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: #0F172A;
    color: var(--gray-300);
    padding: 5rem 2rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-logo img {
    height: 36px;
    filter: brightness(0) invert(1);
}

.footer-tagline {
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--gray-400);
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column a {
    display: block;
    font-size: 0.9375rem;
    color: var(--gray-400);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #1E293B;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .cl-hero-container {
        gap: 3rem;
    }

    .cl-floating-badge.score {
        right: -30px;
    }
}

@media (max-width: 1024px) {
    .cl-hero {
        padding: 8rem 1.5rem 4rem;
    }

    .cl-hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .cl-hero-content {
        padding-right: 0;
    }

    .cl-hero-title {
        font-size: 2.75rem;
    }

    .cl-hero-description {
        max-width: 100%;
        margin: 0 auto 2rem;
    }

    .cl-hero-cta {
        justify-content: center;
    }

    .cl-hero-trust {
        justify-content: center;
        flex-wrap: wrap;
    }

    .cl-hero-visual {
        padding: 0;
        margin-top: 1rem;
    }

    .cl-preview-card {
        margin: 0 auto;
    }

    .cl-floating-badge.score {
        right: 20px;
        top: 10%;
    }

    .cl-floating-badge.ai {
        left: 20px;
        bottom: 10%;
    }

    .cl-features-grid,
    .cl-templates-grid,
    .cl-examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cl-success-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .footer-links {
        justify-items: center;
    }

    .footer-column {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .cl-hero {
        padding: 7rem 1rem 3rem;
    }

    .cl-hero-title {
        font-size: 2rem;
    }

    .cl-hero-description {
        font-size: 1rem;
    }

    .cl-hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .cl-hero-cta .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .cl-preview-card {
        width: 280px;
    }

    .cl-floating-badge.score {
        top: -10px;
        right: 10px;
        padding: 0.625rem 1rem;
    }

    .cl-floating-badge.score .badge-value {
        font-size: 1.25rem;
    }

    .cl-floating-badge.ai {
        bottom: -10px;
        left: 10px;
        padding: 0.5rem 0.875rem;
    }

    .trust-logos {
        gap: 2rem;
    }

    .trust-logo {
        font-size: 1.25rem;
    }

    .cl-features,
    .cl-success-section,
    .cl-templates-section,
    .cl-examples-section {
        padding: 4rem 1rem;
    }

    .cl-features-grid,
    .cl-success-grid,
    .cl-templates-grid,
    .cl-examples-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cl-feature-card,
    .cl-success-card,
    .cl-template-card {
        padding: 1.5rem;
    }

    .steps-3 {
        grid-template-columns: 1fr;
    }

    .cl-final-cta {
        padding: 4rem 1rem;
    }

    .cl-final-cta .cta-content h2 {
        font-size: 1.75rem;
    }

    .cl-final-cta .cta-content p {
        font-size: 1rem;
    }

    .footer {
        padding: 3rem 1rem 1.5rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .cl-hero-title {
        font-size: 1.75rem;
    }

    .trust-avatars {
        margin-bottom: 0.5rem;
    }

    .cl-hero-trust {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cl-preview-card {
        width: 260px;
    }

    .cl-floating-badge.score,
    .cl-floating-badge.ai {
        position: static;
        margin: 0.5rem auto;
        display: inline-flex;
    }

    .cl-hero-visual {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .cl-final-cta .cta-content h2 {
        font-size: 1.5rem;
    }
}