/* ================================================================
   PAGES.CSS — Inner page styles for Robocash PH
   Uses CSS variables from style.css (:root)
   ================================================================ */

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(123, 45, 142, 0.25); }
    50% { box-shadow: 0 0 20px rgba(123, 45, 142, 0.45); }
}

@keyframes gradientPulse {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes borderGlow {
    0%, 100% { border-color: var(--primary-light); }
    50% { border-color: var(--accent); }
}

@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lineGradientPulse {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 200%; }
}


/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== PAGE HERO BANNER ===== */
.page-hero {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Wave / curved bottom edge */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), 50% 100%, 0 calc(100% - 32px));
}

/* Dot pattern overlay */
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* Decorative gradient orb */
.page-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.page-hero-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out both;
}

.page-hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s 0.15s ease-out both;
}


/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s 0.3s ease-out both;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    font-weight: 600;
}

.breadcrumb a:hover {
    color: #fff;
}

.breadcrumb .breadcrumb-sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.breadcrumb .breadcrumb-current {
    color: var(--accent);
    font-weight: 700;
}


/* ===== PAGE CONTENT LAYOUT ===== */

/* Two-column layout (content + sidebar) */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
}

/* Single-column centered layout (no sidebar) */
.page-layout-single {
    max-width: 800px;
    margin: 0 auto;
}

.page-content {
    min-width: 0;
}

.page-sidebar {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}


/* ===== ARTICLE / CONTENT STYLES ===== */
.article-content h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: 40px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 32px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-content p {
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 16px;
}

.article-content a:not(.btn) {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(123, 45, 142, 0.3);
    text-underline-offset: 3px;
    transition: var(--transition);
}

.article-content a:not(.btn):hover {
    text-decoration-color: var(--primary);
}

/* Buttons inside article content should not inherit link styles */
.article-content .btn {
    text-decoration: none;
}

.article-content a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.article-content strong {
    font-weight: 700;
    color: var(--text);
}

/* Unordered lists */
.article-content ul {
    margin-bottom: 20px;
    padding-left: 0;
    list-style: none;
}

.article-content ul li {
    padding: 5px 0 5px 28px;
    position: relative;
    line-height: 1.7;
    color: var(--text);
}

.article-content ul li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 14px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

/* Ordered lists */
.article-content ol {
    margin-bottom: 20px;
    padding-left: 0;
    counter-reset: ol-counter;
    list-style: none;
}

.article-content ol li {
    padding: 5px 0 5px 32px;
    position: relative;
    line-height: 1.7;
    color: var(--text);
    counter-increment: ol-counter;
    list-style: none;
}

.article-content ol li::before {
    content: counter(ol-counter) '.';
    position: absolute;
    left: 4px;
    font-weight: 800;
    color: var(--primary);
    font-size: 0.95rem;
}

/* Blockquote */
.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg-gray);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text);
    line-height: 1.8;
}

.article-content blockquote p {
    margin-bottom: 0;
}


/* ===== INFO / WARNING / TIP BOXES (Enhanced) ===== */
.info-box,
.warning-box,
.tip-box {
    padding: 20px 24px 20px 56px;
    border-radius: var(--radius-sm);
    margin: 24px 0;
    line-height: 1.7;
    position: relative;
    border-left: 4px solid transparent;
    transition: var(--transition);
}

.info-box::before,
.warning-box::before,
.tip-box::before {
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 1.3rem;
    line-height: 1;
}

/* Info box */
.info-box {
    background: rgba(123, 45, 142, 0.05);
    border: 1px solid rgba(123, 45, 142, 0.12);
    border-left: 4px solid var(--primary);
    color: var(--text);
}

.info-box::before {
    content: '\2139';
    color: var(--primary);
    font-weight: 700;
}

/* Warning box */
.warning-box {
    background: rgba(255, 152, 0, 0.06);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-left: 4px solid #E65100;
    color: var(--text);
}

.warning-box::before {
    content: '\26A0';
    color: #E65100;
}

/* Tip box */
.tip-box {
    background: rgba(46, 125, 50, 0.05);
    border: 1px solid rgba(46, 125, 50, 0.15);
    border-left: 4px solid var(--green);
    color: var(--text);
}

.tip-box::before {
    content: '\2714';
    color: var(--green);
    font-weight: 700;
}

/* Box title bar */
.info-box-title,
.warning-box-title,
.tip-box-title {
    font-weight: 800;
    margin-bottom: 6px;
    display: block;
    font-size: 1rem;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.info-box-title {
    color: var(--primary-dark);
}

.warning-box-title {
    color: #E65100;
}

.tip-box-title {
    color: var(--green);
}


/* ===== TABLE STYLES (Enhanced) ===== */
.table-responsive {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
    /* Smooth horizontal scroll on mobile */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Scroll-hint shadows on edges */
.table-responsive::before,
.table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-responsive::before {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.06), transparent);
}

.table-responsive::after {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.06), transparent);
}

.table-responsive.is-scrollable::after {
    opacity: 1;
}

.table-responsive.is-scrolled-start::before {
    opacity: 0;
}

.table-responsive.is-scrolled-middle::before,
.table-responsive.is-scrolled-middle::after {
    opacity: 1;
}

.table-responsive.is-scrolled-end::after {
    opacity: 0;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 0.9rem;
    table-layout: auto;
}

.table-responsive thead {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
}

.table-responsive th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Logo column - wider */
.table-responsive td:first-child {
    min-width: 100px;
    text-align: center;
}

/* Apply button column */
.table-responsive td:last-child .btn {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.78rem;
}

/* border-radius handled by wrapper */

.table-responsive td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
    transition: var(--transition);
    font-size: 0.88rem;
}

/* Small button inside table cells */
.table-responsive .btn-sm {
    padding: 8px 16px;
    font-size: 0.78rem;
    border-radius: 8px;
    white-space: nowrap;
}

.table-responsive tbody tr:nth-child(even) {
    background: var(--bg-gray);
}

.table-responsive tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius);
}

.table-responsive tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--radius) 0;
}

.table-responsive tbody tr {
    transition: var(--transition);
}

.table-responsive tbody tr:hover {
    background: rgba(123, 45, 142, 0.05);
}

.table-responsive tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 0 var(--primary);
}

.table-responsive td strong {
    color: var(--primary-dark);
}


/* ===== LENDER REVIEW CARD (Enhanced) ===== */
.lender-review {
    background: #fff;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    padding: 32px;
    margin-bottom: 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.lender-review::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lender-review:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.lender-review:hover::before {
    opacity: 1;
}

.lender-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.lender-review-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.lender-review-logo-placeholder {
    width: 160px;
    height: 48px;
    background: var(--bg-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary-dark);
    font-size: 1.2rem;
}

/* Score circle */
.lender-review-rating {
    text-align: center;
}

.lender-review-score {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    box-shadow: 0 4px 16px rgba(123, 45, 142, 0.25);
}

.lender-review-score-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

.lender-review-stars {
    color: var(--accent);
    letter-spacing: 2px;
    font-size: 1.1rem;
    margin-top: 4px;
}

.lender-review-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Pros & Cons with tinted backgrounds */
.lender-pros,
.lender-cons {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
}

.lender-pros {
    background: rgba(46, 125, 50, 0.04);
    border: 1px solid rgba(46, 125, 50, 0.12);
}

.lender-cons {
    background: rgba(198, 40, 40, 0.04);
    border: 1px solid rgba(198, 40, 40, 0.12);
}

.lender-pros h4,
.lender-cons h4 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lender-pros h4 {
    color: var(--green);
}

.lender-cons h4 {
    color: #C62828;
}

.lender-pros li,
.lender-cons li {
    padding: 5px 0 5px 24px;
    font-size: 0.9rem;
    position: relative;
    line-height: 1.6;
    color: var(--text);
}

.lender-pros li::before {
    content: '+';
    position: absolute;
    left: 4px;
    font-weight: 800;
    color: var(--green);
}

.lender-cons li::before {
    content: '\2013';
    position: absolute;
    left: 4px;
    font-weight: 800;
    color: #C62828;
}

/* Details section with better visual separation */
.lender-review-details {
    border-top: 2px solid var(--bg-gray);
    padding-top: 20px;
    margin-top: 4px;
}

.lender-review-details table {
    width: 100%;
    border-collapse: collapse;
}

.lender-review-details td {
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-gray);
    font-size: 0.95rem;
}

.lender-review-details td:first-child {
    color: var(--text-light);
    font-weight: 600;
    width: 40%;
}

.lender-review-details td:last-child {
    font-weight: 700;
    color: var(--text);
}

.lender-review-details tr:last-child td {
    border-bottom: none;
}

.lender-review-cta {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}


/* ===== CTA INLINE BOX (Enhanced) ===== */
.cta-inline {
    background: linear-gradient(135deg, rgba(123, 45, 142, 0.06) 0%, rgba(255, 193, 7, 0.08) 100%);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 32px 36px;
    margin: 32px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Animated gradient border via background-clip trick */
    background-clip: padding-box;
}

.cta-inline::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent), var(--primary));
    background-size: 200% 200%;
    animation: gradientPulse 4s ease infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

.cta-inline > * {
    position: relative;
    z-index: 1;
}

.cta-inline h3 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.cta-inline p {
    color: var(--text-light);
    margin-bottom: 16px;
    font-size: 0.95rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cta-inline .btn {
    margin-top: 4px;
}


/* ===== AUTHOR BOX (E-E-A-T) ===== */
.author-box {
    display: flex;
    gap: 24px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 48px;
    border: 1px solid var(--border);
}

.author-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: rgba(123, 45, 142, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--primary);
    font-size: 1.5rem;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.author-info {
    min-width: 0;
}

.author-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 4px;
}

.author-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.author-credentials {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 8px;
}

.author-bio {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.7;
}

.author-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.author-links a {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    transition: var(--transition);
}

.author-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}


/* ===== RELATED POSTS GRID ===== */
.related-posts {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 2px solid var(--border);
}

.related-posts-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 24px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}


/* ===== BLOG GRID (new utility class) ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}


/* ===== BLOG CARD (Enhanced) ===== */
.blog-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    position: relative;
    cursor: pointer;
    flex-direction: column;
}

.blog-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

/* Image area with icon placeholder and zoom on hover */
.blog-card-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-gray) 0%, rgba(123, 45, 142, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.85rem;
    overflow: hidden;
    position: relative;
}

/* CSS-only placeholder icon (document/article symbol) */
.blog-card-image::before {
    content: '\1F4C4';
    position: absolute;
    font-size: 2.4rem;
    opacity: 0.2;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.06);
}

/* Hide the placeholder icon when a real image is present */
.blog-card-image img ~ ::before,
.blog-card-image:has(img)::before {
    opacity: 0;
}

.blog-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

/* Category color system */
.blog-card-category {
    padding: 3px 10px;
    background: rgba(123, 45, 142, 0.08);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

/* Loan Guide - Primary purple */
.blog-card-category[data-category="loan-guide"],
.blog-card-category.cat-loan-guide {
    background: rgba(123, 45, 142, 0.1);
    color: var(--primary);
}

/* Review - Accent gold/amber */
.blog-card-category[data-category="review"],
.blog-card-category.cat-review {
    background: rgba(255, 193, 7, 0.15);
    color: #B8860B;
}

/* Financial Literacy - Green */
.blog-card-category[data-category="financial-literacy"],
.blog-card-category.cat-financial-literacy {
    background: rgba(46, 125, 50, 0.1);
    color: var(--green);
}

/* Tips - Blue */
.blog-card-category[data-category="tips"],
.blog-card-category.cat-tips {
    background: rgba(25, 118, 210, 0.1);
    color: #1565C0;
}

.blog-card-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.blog-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-title a {
    color: inherit;
    transition: var(--transition);
}

/* Make entire blog card clickable via stretched link */
.blog-card-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.blog-card-title a:hover {
    color: var(--primary);
}

.blog-card-title a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.blog-card-link:hover {
    color: var(--primary-dark);
    gap: 8px;
}

.blog-card-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.blog-card-link::after {
    content: '\2192';
}


/* ===== CONTACT FORM (Enhanced with floating labels) ===== */
.contact-form {
    max-width: 640px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

/* Standard label (non-floating) */
.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    transition: var(--transition);
}

.form-label .required {
    color: #C62828;
}

/* Floating label mode: add .form-group-float to .form-group */
.form-group-float {
    position: relative;
    margin-bottom: 24px;
}

.form-group-float .form-label {
    position: absolute;
    left: 16px;
    top: 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0;
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.25s ease,
                font-size 0.25s ease;
    z-index: 1;
    background: transparent;
}

.form-group-float .form-input:focus ~ .form-label,
.form-group-float .form-input:not(:placeholder-shown) ~ .form-label,
.form-group-float .form-textarea:focus ~ .form-label,
.form-group-float .form-textarea:not(:placeholder-shown) ~ .form-label,
.form-group-float .form-select:focus ~ .form-label,
.form-group-float .form-select:valid ~ .form-label {
    transform: translateY(-22px) scale(0.8);
    color: var(--primary);
    font-weight: 700;
    background: #fff;
    padding: 0 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
}

/* Animated focus ring */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(123, 45, 142, 0.1),
                0 0 0 6px rgba(123, 45, 142, 0.04);
}

.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
    outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

/* Hide placeholder when using floating labels so the label animates properly */
.form-group-float .form-input::placeholder,
.form-group-float .form-textarea::placeholder {
    color: transparent;
}

.form-group-float .form-input:focus::placeholder,
.form-group-float .form-textarea:focus::placeholder {
    color: var(--text-light);
    opacity: 0.4;
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.form-error {
    font-size: 0.8rem;
    color: #C62828;
    margin-top: 4px;
    display: none;
}

.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
    border-color: #C62828;
}

.form-group.error .form-error {
    display: block;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-submit {
    margin-top: 8px;
}

/* Submit button loading state */
.form-submit .btn.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.form-submit .btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinLoader 0.6s linear infinite;
}

.form-success {
    background: rgba(46, 125, 50, 0.08);
    border: 1px solid rgba(46, 125, 50, 0.2);
    color: var(--green);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: none;
}


/* ===== STEP CARDS (HOW-TO VERTICAL, Enhanced) ===== */
.step-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 40px;
}

/* Connecting line with gradient pulse */
.step-cards::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-light), var(--accent), var(--primary));
    background-size: 100% 200%;
    animation: lineGradientPulse 3s linear infinite;
    border-radius: 1px;
}

.step-card {
    position: relative;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 16px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.step-card:last-child {
    margin-bottom: 0;
}

.step-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: scale(1.015);
}

/* Step number with subtle glow */
.step-card-number {
    position: absolute;
    left: -41px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(123, 45, 142, 0.3),
                0 0 16px rgba(123, 45, 142, 0.15);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease;
}

.step-card:hover .step-card-number {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(123, 45, 142, 0.4),
                0 0 24px rgba(123, 45, 142, 0.2);
}

.step-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.step-card-content {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.7;
}

.step-card-content p {
    margin-bottom: 8px;
}

.step-card-content p:last-child {
    margin-bottom: 0;
}


/* ===== SIDEBAR (Enhanced) ===== */

/* Sidebar CTA card */
.sidebar-cta {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
}

/* Badge option (Popular / Most Chosen) */
.sidebar-badge {
    display: inline-block;
    padding: 4px 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 100px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.sidebar-cta h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.sidebar-cta p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 16px;
}

.sidebar-cta ul {
    text-align: left;
    margin-bottom: 16px;
    list-style: none;
    padding: 0;
}

.sidebar-cta ul li {
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text);
    border-bottom: 1px solid var(--bg-gray);
    position: relative;
    padding-left: 20px;
}

.sidebar-cta ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
}

.sidebar-cta ul li:last-child {
    border-bottom: none;
}

.sidebar-cta .btn {
    width: 100%;
}


/* ================================================================
   GENERAL IMPROVEMENTS — Transitions, Focus States, Animations
   ================================================================ */

/* Global smoother transitions */
a, button, input, select, textarea {
    transition: var(--transition);
}

/* Better focus states for accessibility */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Skip to content helper (hidden until focused) */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 700;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* Reduced motion: disable animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ================================================================
   RESPONSIVE — PAGES
   ================================================================ */

@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .page-sidebar {
        position: static;
    }

    .lender-review-body {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .page-hero {
        padding: 96px 0 48px;
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), 50% 100%, 0 calc(100% - 20px));
    }

    .page-hero-title {
        font-size: 1.7rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .page-hero-subtitle {
        font-size: 1rem;
    }

    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 20px;
    }

    .author-links {
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cta-inline {
        padding: 24px 20px;
    }

    .cta-inline h3 {
        font-size: 1.2rem;
    }

    .lender-review {
        padding: 24px 20px;
    }

    .lender-review-header {
        flex-direction: column;
        text-align: center;
    }

    .lender-review-cta {
        justify-content: center;
    }

    .lender-review-cta .btn {
        min-height: 44px;
    }

    .step-cards {
        padding-left: 32px;
    }

    .step-cards::before {
        left: 15px;
    }

    .step-card-number {
        left: -33px;
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .article-content h2 {
        font-size: 1.4rem;
        margin-top: 32px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .article-content h3 {
        font-size: 1.1rem;
        margin-top: 24px;
    }

    .article-content p {
        font-size: 0.95rem;
    }

    /* Sidebar on mobile */
    .page-sidebar {
        order: 2;
    }

    .sidebar-cta {
        padding: 20px 16px;
    }

    .sidebar-cta h3 {
        font-size: 1rem;
    }

    .sidebar-cta .btn {
        min-height: 44px;
    }

    /* Table: ensure no content spills outside wrapper */
    .table-responsive {
        max-width: 100%;
    }

    /* Table scroll hints active on mobile */
    .table-responsive::after {
        opacity: 1;
    }

    /* Ensure border-collapse removes ghost vertical lines between cells */
    .table-responsive table {
        min-width: 560px;
        border-collapse: collapse;
    }

    /* Remove any potential ghost borders on th/td */
    .table-responsive th,
    .table-responsive td {
        padding: 10px 12px;
        font-size: 0.84rem;
        border-right: none;
    }

    .table-responsive th {
        font-size: 0.74rem;
    }

    /* Disable hover inset shadow on mobile (can cause ghost lines) */
    .table-responsive tbody tr:hover td:first-child {
        box-shadow: none;
    }

    /* Form inputs tappable */
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px;
        font-size: 1rem; /* Prevent iOS zoom on focus */
    }

    /* Blog card body text readability */
    .blog-card-excerpt {
        font-size: 0.88rem;
    }

    .blog-card-title {
        font-size: 1rem;
    }

    /* Info/warning/tip boxes */
    .info-box,
    .warning-box,
    .tip-box {
        padding: 16px 16px 16px 48px;
        margin: 20px 0;
    }
}

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

    .page-hero {
        padding: 80px 0 40px;
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 50% 100%, 0 calc(100% - 14px));
    }

    .page-hero-subtitle {
        font-size: 0.9rem;
    }

    .blog-card-image {
        height: 150px;
    }

    .blog-card-body {
        padding: 16px;
    }

    .blog-card-title {
        font-size: 0.95rem;
    }

    .lender-review {
        padding: 20px 14px;
    }

    .lender-review-details td:first-child {
        width: auto;
    }

    .lender-review-details table,
    .lender-review-details tbody,
    .lender-review-details tr,
    .lender-review-details td {
        display: block;
        width: 100%;
    }

    .lender-review-details tr {
        padding: 8px 0;
        border-bottom: 1px solid var(--bg-gray);
    }

    .lender-review-details td {
        padding: 2px 0;
        border-bottom: none;
    }

    .info-box,
    .warning-box,
    .tip-box {
        padding-left: 44px;
        padding-right: 14px;
        font-size: 0.9rem;
    }

    .info-box::before,
    .warning-box::before,
    .tip-box::before {
        left: 14px;
        font-size: 1.1rem;
    }

    .step-cards {
        padding-left: 28px;
    }

    .step-cards::before {
        left: 13px;
    }

    .step-card-number {
        left: -29px;
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .step-card {
        padding: 16px;
    }

    .step-card-title {
        font-size: 1rem;
    }

    .step-card-content {
        font-size: 0.88rem;
    }

    .lender-review-score {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }

    /* Author box on very small screens */
    .author-box {
        padding: 20px 14px;
    }

    .author-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.2rem;
    }

    .author-name {
        font-size: 1rem;
    }

    .author-bio {
        font-size: 0.85rem;
    }

    /* CTA inline */
    .cta-inline {
        padding: 20px 14px;
    }

    .cta-inline h3 {
        font-size: 1.1rem;
    }

    .cta-inline p {
        font-size: 0.88rem;
    }

    /* Table on very small screens */
    .table-responsive table {
        min-width: 500px;
    }

    .table-responsive th,
    .table-responsive td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    /* Sidebar CTA */
    .sidebar-cta {
        padding: 16px 14px;
    }

    .sidebar-cta ul li {
        font-size: 0.82rem;
    }
}


/* ================================================================
   PRINT STYLES — Hide non-essential UI for printing
   ================================================================ */
@media print {
    /* Hide navigation, footer, sidebar, and interactive elements */
    .navbar,
    .nav,
    .header,
    .hamburger,
    .mobile-menu,
    .footer,
    .sticky-bar,
    .peso-bubbles,
    .loading-overlay,
    .offers-modal,
    .cta-strip,
    .cta-bottom,
    .page-sidebar,
    .sidebar-cta,
    .cta-inline,
    .lender-review-cta,
    .form-submit,
    .blog-card-link::after,
    .breadcrumb,
    .related-posts,
    .author-links {
        display: none !important;
    }

    /* Reset layout to single column */
    .page-layout {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Remove decorative effects */
    .page-hero {
        clip-path: none !important;
        background: var(--primary-dark) !important;
        padding: 24px 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-hero::before,
    .page-hero::after {
        display: none !important;
    }

    /* Clean up cards for print */
    .blog-card,
    .step-card,
    .lender-review {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    .blog-card:hover,
    .step-card:hover,
    .lender-review:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* Ensure text is readable */
    .article-content a {
        color: var(--primary-dark) !important;
    }

    .article-content a::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }

    /* Table print styles */
    .table-responsive {
        overflow: visible !important;
    }

    .table-responsive::before,
    .table-responsive::after {
        display: none !important;
    }

    .table-responsive table {
        min-width: 0 !important;
    }

    /* Step cards: hide animation elements */
    .step-cards::before {
        animation: none !important;
    }

    .sidebar-cta {
        animation: none !important;
    }
}
