* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%; /* Prevents iOS text scaling */
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent; /* Removes blue highlight on tap */
    touch-action: manipulation; /* Improves touch responsiveness */
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
}

.header {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1e40af 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.header h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 700;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header p {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* Value badges in header */
.header-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    position: relative;
}

.header-badge {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}

.header-badge.highlight {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
    border: none;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: calc(100vh - 180px);
    min-height: 600px;
    max-height: 900px;
}

/* Ensure side-by-side layout for desktop computers */
@media (min-width: 1025px) {
    .main-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        height: calc(100vh - 180px);
        min-height: 600px;
        max-height: 900px;
    }

    .form-panel {
        order: 1; /* Form inputs on the left */
    }

    .preview-panel {
        order: 2; /* Live preview on the right */
    }
}

.form-panel, .preview-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Form panel scrolls internally with content + buttons together */
.form-panel {
    overflow-y: auto;
}

.form-panel {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.preview-panel {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    min-height: 0; /* Critical for flex scroll */
}

/* Tab Navigation */
.tab-navigation {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    overflow-x: auto;
    padding: 0 8px;
    gap: 4px;
}

.tab-button {
    flex: 1;
    min-width: 90px;
    padding: 12px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    border-radius: 8px 8px 0 0;
    margin-top: 4px;
}

.tab-button:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
}

.tab-button:active {
    background: rgba(59, 130, 246, 0.12);
}

.tab-button.active {
    background: white;
    color: #1e40af;
    border-bottom-color: #3b82f6;
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

/* Tab number badges */
.tab-button::before {
    content: attr(data-step);
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 6px;
}

.tab-button.active::before {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.tab-button.completed::before {
    content: '✓';
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* Form Content */
.form-content {
    padding: 30px;
    flex: none;
    overflow-y: visible;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 44px; /* Better touch target */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
}

/* Prevent zoom on iOS */
@media screen and (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* Checkboxes - COMPACT DESIGN */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns on desktop */
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    background: #fafbfc;
    position: relative;
}

.checkbox-item:hover {
    background-color: #f0f4ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.checkbox-item:active {
    transform: translateY(0);
}

.checkbox-item.selected {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: white;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
    color: #1e293b;
    font-size: 0.875rem;
    line-height: 1.3;
}

/* COMPACT: Hide descriptions by default, show only on hover as tooltip */
.checkbox-description {
    display: none;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

/* Desktop: Only show description on hover as tooltip (NOT on selection) */
@media (min-width: 769px) {
    .checkbox-item {
        position: relative;
        z-index: 1;
    }

    /* Raise z-index on hover so tooltip appears above other items */
    .checkbox-item:hover {
        z-index: 50;
    }

    /* Only show on hover, not on selection - prevents overlap */
    .checkbox-item:hover .checkbox-description {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: #1e293b;
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        z-index: 100;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        margin-top: 4px;
        font-size: 0.8rem;
    }

    .checkbox-item:hover .checkbox-description::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 20px;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid #1e293b;
    }
}

/* Mobile: Show description inline when selected (tooltips don't work well on touch) */
@media (max-width: 768px) {
    .checkbox-item.selected .checkbox-description {
        display: block;
        position: static;
        background: transparent;
        color: #64748b;
        padding: 0;
        margin-top: 6px;
    }
}

/* Navigation Buttons */
.navigation-buttons {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px; /* Better touch target */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    justify-content: center;
}

.nav-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-button.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.consultation-button {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.consultation-button:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
}

/* Preview Panel */
.preview-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Critical for flex children to scroll */
}

.preview-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 16px 20px;
    border-bottom: none;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-header h2 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.preview-text {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
}

/* Scroll indicator */
.preview-scroll-hint {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #fcd34d;
}

.preview-scroll-hint::before {
    content: '↕';
    font-size: 1rem;
}

.document-preview {
    padding: 24px;
    background: white;
    margin: 8px;
    border-radius: 8px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 11pt;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-y: scroll !important;
    overflow-x: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Fixed height approach */
    height: calc(100% - 100px);
    max-height: 500px;
}

/* Custom scrollbar for preview */
.document-preview::-webkit-scrollbar {
    width: 10px;
}

.document-preview::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.document-preview::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

.document-preview::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
}

/* Highlighting */
.highlighted-text {
    background-color: #fff9c4;
    display: inline;
    padding: 2px 0;
    animation: highlight 8s ease-out;
}

@keyframes highlight {
    0% { background-color: #ffeb3b; }
    20% { background-color: #fff9c4; }
    100% { background-color: #fff9c4; }
}

/* Risk Assessment Cards */
.risk-card {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.risk-strong {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.risk-moderate {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.risk-weak {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.risk-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.risk-card p {
    margin-bottom: 15px;
}

.risk-recommendations {
    list-style: none;
    padding: 0;
}

.risk-recommendations li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.risk-recommendations li:last-child {
    border-bottom: none;
}

/* Tips and Alerts */
.tip-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 16px 0;
    font-size: 0.875rem;
}

.tip-box.warning {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-color: #fcd34d;
    border-left-color: #f59e0b;
    color: #78350f;
}

.tip-box.info {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
    border-left-color: #10b981;
    color: #065f46;
}

.tip-title {
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

/* Tooltips and Hints */
.hint-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    cursor: help;
}

.hint-tooltip .tooltip-icon {
    color: #6c757d;
    font-size: 14px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e9ecef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.hint-tooltip:hover .tooltip-icon {
    background: #007bff;
    color: white;
}

.hint-tooltip .tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hint-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.hint-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.legal-claim {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.legal-claim h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-claim p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        height: auto;
        max-height: none;
    }

    .preview-panel {
        order: -1;
        max-height: 550px;
        min-height: 400px;
    }

    .document-preview {
        max-height: 420px;
        min-height: 320px;
        font-size: 11pt;
        height: calc(100% - 80px) !important;
    }

    .form-panel, .preview-panel {
        max-height: none;
    }

    .form-content {
        max-height: none;
        overflow-y: visible;
    }
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    .app-container {
        padding: 15px;
    }
    
    .main-content {
        gap: 25px;
    }
    
    .navigation-buttons {
        padding: 18px 25px;
        gap: 12px;
    }
    
    .nav-button {
        padding: 12px 18px;
        font-size: 0.95rem;
        min-height: 44px; /* Better touch target */
    }
    
    .tab-button {
        padding: 14px 10px;
        font-size: 0.9rem;
        min-height: 48px; /* Better touch target */
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px;
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 44px; /* Better touch target */
    }
    
    .checkbox-item {
        padding: 16px;
        min-height: 44px; /* Better touch target */
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .app-container {
        padding: 8px;
        margin: 0;
    }
    
    .header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .header h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .main-content {
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .form-content {
        padding: 15px;
    }
    
    .navigation-buttons {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
    }
    
    .navigation-buttons > div {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    
    .nav-button {
        flex: 1;
        padding: 12px 8px;
        font-size: 0.85rem;
        min-height: 48px; /* Better touch target */
        justify-content: center;
        text-align: center;
        border-radius: 8px;
    }
    
    .consultation-button {
        flex: 1.2; /* Slightly larger */
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .tab-navigation::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .tab-button {
        padding: 14px 12px;
        font-size: 0.8rem;
        min-width: 120px;
        min-height: 48px; /* Better touch target */
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 12px;
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 48px; /* Better touch target */
        border-radius: 8px;
        border-width: 2px;
    }
    
    .form-group textarea {
        min-height: 80px;
        resize: vertical;
    }
    
    .checkbox-grid {
        gap: 10px;
    }
    
    .checkbox-item {
        padding: 16px 12px;
        min-height: 56px; /* Better touch target for checkboxes */
        border-radius: 8px;
        border-width: 2px;
    }
    
    .checkbox-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
    
    .checkbox-label {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .checkbox-description {
        font-size: 0.85rem;
        margin-top: 6px;
    }
    
    .preview-panel {
        max-height: 500px;
        min-height: 400px;
    }

    .preview-header {
        padding: 12px 15px;
    }

    .preview-header h2 {
        font-size: 1.1rem;
    }

    .document-preview {
        padding: 15px;
        font-size: 11pt;
        line-height: 1.5;
        max-height: 380px;
        min-height: 300px;
        height: auto !important;
    }
    
    .risk-card {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .tip-box {
        padding: 12px;
        margin: 12px 0;
        border-radius: 8px;
    }
    
    .guidance-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .guidance-card {
        padding: 15px;
        border-radius: 8px;
    }
    
    .evidence-item {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    /* Hide tooltips on mobile - they don't work well with touch */
    .hint-tooltip .tooltip-text {
        display: none;
    }
    
    /* Better form section headers */
    .form-content h3 {
        font-size: 1.1rem;
        margin-top: 20px;
        margin-bottom: 12px;
        padding: 10px 0;
        border-bottom: 2px solid #007bff;
        color: #007bff;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    .app-container {
        padding: 5px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .form-content {
        padding: 12px;
    }
    
    .navigation-buttons {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .nav-button {
        padding: 12px 6px;
        font-size: 0.8rem;
    }
    
    .tab-button {
        padding: 12px 8px;
        font-size: 0.75rem;
        min-width: 100px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 10px;
    }
    
    .checkbox-item {
        padding: 14px 10px;
    }
    
    .document-preview {
        padding: 12px;
        font-size: 10pt;
        max-height: 350px;
        min-height: 280px;
    }
}

/* Landscape mobile phones */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .preview-panel {
        order: 0;
        max-height: 250px;
    }
    
    .form-content {
        max-height: 250px;
        overflow-y: auto;
    }
    
    .navigation-buttons {
        position: relative;
        flex-direction: row;
    }
    
    .navigation-buttons > div {
        flex-direction: row;
    }
    
    .nav-button {
        flex: 0 0 auto;
        min-width: 80px;
    }
}

/* Mobile scrolling improvements */
.form-content,
.document-preview {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Better visual feedback for mobile interactions */
.form-group input:active,
.form-group select:active,
.form-group textarea:active {
    transform: scale(0.998);
    transition: transform 0.1s ease;
}

/* Improved loading states for mobile */
.nav-button:active {
    transform: scale(0.98);
}

/* eSignature Modal Styles */
.esignature-modal-overlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.esignature-modal-content {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* eSignature Button Enhancements */
.nav-button:disabled {
    cursor: not-allowed;
    opacity: 0.6 !important;
}

.nav-button.esign-button {
    position: relative;
    overflow: hidden;
}

.nav-button.esign-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-button.esign-button:hover:before {
    left: 100%;
}

/* Mobile responsiveness for eSignature modal */
@media (max-width: 768px) {
    .esignature-modal-content {
        width: 95%;
        height: 90%;
        padding: 15px;
    }
    
    .navigation-buttons > div {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-button {
        min-width: 120px;
        font-size: 13px;
        padding: 8px 10px;
    }
}

/* Enhanced button hover states for eSignature buttons */
.nav-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.nav-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Better spacing for mobile content */
@media (max-width: 768px) {
    .form-content h3:first-child {
        margin-top: 0;
    }
    
    .form-content h3:last-of-type {
        margin-bottom: 20px;
    }
    
    /* Ensure content doesn't get hidden behind fixed elements */
    .form-content {
        padding-bottom: 100px; /* Account for fixed navigation */
    }
    
    /* Better visual hierarchy on mobile */
    .risk-card h3 {
        font-size: 1.1rem;
    }
    
    .guidance-card h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
}
@media print {
    .form-panel,
    .navigation-buttons,
    .tab-navigation {
        display: none;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .preview-panel {
        box-shadow: none;
        border: none;
    }
    
    .document-preview {
        font-size: 11pt;
        line-height: 1.5;
    }
}
/* Print Styles */
@media print {
    .form-panel,
    .navigation-buttons,
    .tab-navigation {
        display: none;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .preview-panel {
        box-shadow: none;
        border: none;
    }
    
    .document-preview {
        font-size: 11pt;
        line-height: 1.5;
    }
}
.evidence-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.evidence-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.evidence-item strong {
    color: #2c3e50;
    font-size: 1rem;
    display: block;
    margin-bottom: 8px;
}

.evidence-item div {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

/* Evidence Hierarchy Styles */
.evidence-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    min-height: 44px; /* Better touch target */
    -webkit-tap-highlight-color: transparent;
}

.evidence-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.evidence-item:active {
    transform: scale(0.998);
}

.evidence-item strong {
    color: #2c3e50;
    font-size: 1rem;
    display: block;
    margin-bottom: 8px;
}

.evidence-item div {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

/* Additional highlighting sections for new Tab 1 inputs */
.contact-info-highlight {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 2px 4px;
    border-radius: 2px;
}

.establishment-section-highlight {
    background-color: #f3e5f5;
    border-left: 4px solid #9c27b0;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Enhanced form section styling */
.form-content h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* Account establishment section styling */
.establishment-checkboxes {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

/* Improved button group styling */
.navigation-buttons div {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 768px) {
    .navigation-buttons div {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Guidance Cards for Arbitration Tab */
.guidance-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.guidance-card {
    padding: 20px;
    border-radius: 8px;
    border: 2px solid;
}

.guidance-card.include {
    background-color: #d4edda;
    border-color: #28a745;
}

.guidance-card.exclude {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.guidance-card h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.guidance-card ul {
    list-style: none;
    padding: 0;
}

.guidance-card li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.guidance-card li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: inherit;
}


/* Paywall-specific styles */
.preview-non-copyable {
    position: relative;
}

.preview-non-copyable::before {
    content: "🔒 Payment required to copy or download";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 15;
    pointer-events: none;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none; /* Allow scrolling through overlay */
    background: linear-gradient(45deg,
        rgba(255,255,255,0.05) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.05) 50%,
        rgba(255,255,255,0.05) 75%,
        transparent 75%
    );
    background-size: 30px 30px;
    animation: stripe-animate 1s linear infinite;
}

@keyframes stripe-animate {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 30px;
    }
}

/* Paid state button styling */
.nav-button.paid {
    background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-button.paid:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* Unpaid state button styling */
.nav-button.unpaid {
    background: linear-gradient(135deg, #6c757d, #495057) !important;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-button.unpaid::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-button.unpaid:hover::before {
    left: 100%;
}

.nav-button.unpaid:hover {
    background: linear-gradient(135deg, #5a6268, #343a40) !important;
    transform: translateY(-1px);
}

/* Mobile paywall adjustments */
@media (max-width: 768px) {
    .preview-non-copyable::before {
        font-size: 10px;
        padding: 3px 6px;
        top: 5px;
        right: 5px;
    }
    
    .nav-button.unpaid,
    .nav-button.paid {
        font-size: 0.85rem;
        padding: 12px 8px;
    }
}

/* eSignature Modal Styles */
.esignature-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.esignature-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    height: 80%;
    max-width: 1000px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* eSignature Button Enhancements */
.nav-button:disabled {
    cursor: not-allowed;
    opacity: 0.6 !important;
}

.nav-button.esign-button {
    position: relative;
    overflow: hidden;
}

.nav-button.esign-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-button.esign-button:hover:before {
    left: 100%;
}

/* Mobile responsiveness for eSignature modal */
@media (max-width: 768px) {
    .esignature-modal-content {
        width: 95%;
        height: 90%;
        padding: 15px;
    }
    
    .navigation-buttons > div {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-button {
        min-width: 120px;
        font-size: 13px;
        padding: 8px 10px;
    }
}

/* Enhanced button hover states for eSignature buttons */
.nav-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.nav-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================
   HELP TOOLTIP STYLES
   ======================================== */

/* Help tooltip icon - "?" button */
.help-tooltip {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background-color: #6366f1;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: help;
    position: relative;
    vertical-align: middle;
    transition: all 0.2s ease;
    user-select: none;
}

.help-tooltip:hover {
    background-color: #4f46e5;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Tooltip popup */
.help-tooltip::before,
.help-tooltip::after {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 10000;
    pointer-events: none;
}

/* Tooltip text box */
.help-tooltip::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 14px;
    background: #1e293b;
    color: white;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Tooltip arrow */
.help-tooltip::after {
    content: '';
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* Show tooltip on hover */
.help-tooltip:hover::before,
.help-tooltip:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Adjust tooltip position if it would go off-screen on the right */
.help-tooltip[data-tooltip-position="left"]::before {
    left: auto;
    right: -10px;
    transform: none;
}

.help-tooltip[data-tooltip-position="left"]::after {
    left: auto;
    right: 0;
    transform: none;
}

/* Make sure labels can contain the tooltip properly */
.form-group label {
    display: inline-flex;
    align-items: center;
}

/* Mobile adjustments for tooltips */
@media (max-width: 768px) {
    .help-tooltip::before {
        max-width: 220px;
        font-size: 12px;
        padding: 8px 12px;
        left: auto;
        right: -10px;
        transform: none;
    }

    .help-tooltip::after {
        left: auto;
        right: 0;
        transform: none;
    }
}

/* ========================================
   MOBILE OPTIMIZATIONS FOR NEW UX ELEMENTS
   ======================================== */

/* 3-Step Strip Base Styles */
.steps-strip {
    transition: all 0.2s ease;
}

.step-item {
    transition: all 0.2s ease;
}

/* 3-Step Strip - Tablet */
@media (max-width: 768px) {
    .steps-strip {
        font-size: 12px !important;
        gap: 4px !important;
    }

    .step-item {
        padding: 3px 8px !important;
    }
}

/* 3-Step Strip - Mobile */
@media (max-width: 500px) {
    .steps-strip {
        font-size: 11px !important;
    }

    .step-item {
        padding: 3px 6px !important;
    }

    /* Hide arrows on small mobile */
    .step-arrow {
        display: none !important;
    }
}

/* Unlock Export Button */
.unlock-export-btn {
    transition: all 0.2s ease;
}

.unlock-export-btn:hover {
    background-color: #d97706 !important;
    transform: translateY(-1px);
}

.unlock-export-btn:active {
    transform: translateY(0);
}

/* Export Buttons Row */
.export-buttons-row {
    transition: all 0.2s ease;
}

/* Navigation buttons area - Mobile - MINIMAL VERSION */
@media (max-width: 768px) {
    /* Make form panel scroll as one unit, not internal scroll */
    .form-panel {
        height: auto !important;
        overflow: visible !important;
    }

    .form-content {
        flex: none !important;
        overflow-y: visible !important;
        max-height: none !important;
    }

    /* Buttons scroll with content, never sticky */
    .navigation-buttons {
        position: static !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        padding: 10px !important;
        justify-content: center !important;
    }

    .navigation-buttons > div[style*="flex-direction: column"] {
        width: auto !important;
        gap: 4px !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    /* Unlock Export button - inline, not full width */
    .unlock-export-btn {
        width: auto !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* Export hint text */
    .export-hint {
        font-size: 9px !important;
        width: 100% !important;
        text-align: center !important;
        margin: 2px 0 !important;
    }

    /* Export buttons row - inline */
    .export-buttons-row {
        width: auto !important;
        gap: 4px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    /* All buttons - small inline */
    .export-buttons-row .nav-button,
    .navigation-buttons > button.nav-button {
        flex: 0 0 auto !important;
        min-width: auto !important;
        font-size: 11px !important;
        padding: 6px 10px !important;
        min-height: auto !important;
        width: auto !important;
    }

    /* Consultation button */
    .export-buttons-row .consultation-button {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }

    /* All nav buttons compact */
    .nav-button {
        min-height: auto !important;
    }
}

/* Very small mobile phones */
@media (max-width: 480px) {
    .form-panel {
        height: auto !important;
        overflow: visible !important;
    }

    .form-content {
        flex: none !important;
        overflow-y: visible !important;
        max-height: none !important;
    }

    .navigation-buttons {
        position: static !important;
        gap: 3px !important;
        padding: 8px !important;
    }

    .export-buttons-row .nav-button,
    .navigation-buttons > button.nav-button {
        font-size: 10px !important;
        padding: 5px 8px !important;
    }

    .export-buttons-row .consultation-button {
        font-size: 10px !important;
        padding: 5px 8px !important;
    }

    .export-hint {
        font-size: 8px !important;
    }

    .unlock-export-btn {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }

    .nav-button {
        min-height: auto !important;
    }
}

/* Paywall Modal - Mobile Optimizations */
@media (max-width: 600px) {
    .paywall-modal {
        width: 95% !important;
        max-height: 95vh !important;
        margin: 10px !important;
    }

    .paywall-content {
        padding: 15px !important;
    }

    .paywall-header h2 {
        font-size: 1.2rem !important;
    }

    .paywall-features ul {
        font-size: 13px !important;
    }

    .paywall-features li {
        padding: 6px 0 !important;
    }

    .price-display .amount {
        font-size: 2rem !important;
    }

    /* FAQ section more compact on mobile */
    .paywall-content details {
        font-size: 12px !important;
    }

    .paywall-content details > div {
        padding: 8px !important;
    }

    .paywall-content details p {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    /* Mobile notice more prominent */
    .paywall-payment > p[style*="font-size: 12px"] {
        font-size: 11px !important;
        padding: 10px !important;
        margin: 10px 0 !important;
    }
}

/* International address hint - Mobile */
@media (max-width: 768px) {
    .form-group small[style*="font-size: 11px"] {
        font-size: 10px !important;
        line-height: 1.3 !important;
    }

    /* Stripe dashboard link - more tappable on mobile */
    .form-group a[style*="font-size: 11px"] {
        font-size: 12px !important;
        padding: 6px 0 !important;
        display: inline-block !important;
    }
}
