/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

header .subtitle {
    color: #a0a0a0;
    font-size: 14px;
}

/* Progress Bar */
.progress-container {
    padding: 30px 40px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 12.5%;
}

.steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.step {
    font-size: 12px;
    color: #6c757d;
    padding: 6px 12px;
    border-radius: 20px;
    background: #e9ecef;
    transition: all 0.3s ease;
}

.step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
}

.step.completed {
    background: #28a745;
    color: white;
}

/* Disclaimer */
.disclaimer {
    margin: 20px 40px;
    padding: 15px 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    font-size: 14px;
    color: #856404;
}

/* Form Styles */
form {
    padding: 30px 40px;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: #1a1a2e;
    margin-bottom: 10px;
    font-size: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

h3 {
    color: #16213e;
    margin: 25px 0 15px;
    font-size: 18px;
}

h4 {
    color: #343a40;
    margin: 20px 0 10px;
    font-size: 16px;
}

.section-info {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #343a40;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6c757d;
    font-size: 12px;
}

.field-hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.field-hint-row small {
    margin-top: 0;
}

.field-hint-row .required-hint,
.form-group .required-hint {
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
}

.field-hint-row .required-hint.completed,
.form-group .required-hint.completed {
    color: #28a745;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

.radio-label input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-label span {
    flex: 1;
    color: #343a40;
}

.radio-label input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 500;
}

/* Form Rows (for inline fields) */
.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Conditional Sections */
.conditional-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
}

/* Property/Item Lists */
.property-item,
.account-item,
.retirement-item,
.vehicle-item,
.debt-item,
.real-property-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

/* Add Button */
.btn-add {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    color: #667eea;
    border: 2px dashed #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-add:hover {
    background: #667eea;
    color: white;
    border-style: solid;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev {
    background: #e9ecef;
    color: #343a40;
}

.btn-prev:hover {
    background: #dee2e6;
}

.btn-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    margin-left: auto;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
}

.btn-email {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    margin-left: 10px;
}

.btn-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(33, 150, 243, 0.4);
}

.btn-email:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.email-section {
    background: #f0f7ff;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.email-section h3 {
    color: #1976d2;
    margin: 0 0 10px 0;
    border: none;
}

/* Review Section */
#reviewContent {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

#reviewContent h3 {
    color: #667eea;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
    margin-top: 20px;
}

#reviewContent h3:first-child {
    margin-top: 0;
}

.review-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 500;
    color: #343a40;
    min-width: 200px;
}

.review-value {
    color: #6c757d;
    flex: 1;
}

/* Important Notice Box */
.important-notice {
    background: #e8f4fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.important-notice h3 {
    color: #1976d2;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.important-notice ul {
    margin: 0;
    padding-left: 20px;
}

.important-notice li {
    color: #1565c0;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 22px;
    }

    .progress-container,
    form {
        padding: 20px;
    }

    .disclaimer {
        margin: 15px 20px;
    }

    .steps {
        justify-content: center;
    }

    .step {
        font-size: 10px;
        padding: 4px 8px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        min-width: 100%;
    }

    .form-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .btn-next, .btn-generate {
        margin-left: 0;
    }

    .btn-email {
        margin-left: 0;
    }
}

/* Floating Navigation Buttons */
.floating-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-nav:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.floating-prev {
    left: 15px;
    background: #e9ecef;
    color: #343a40;
}

.floating-prev:hover {
    background: #dee2e6;
}

.floating-next {
    right: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

@media (max-width: 768px) {
    .floating-nav {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .floating-prev {
        left: 8px;
    }

    .floating-next {
        right: 8px;
    }
}

@media print {
    .floating-nav {
        display: none !important;
    }
}

/* Print styles for PDF */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    .progress-container,
    .form-navigation,
    .disclaimer {
        display: none;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #dc3545;
}

.form-group .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

/* Schedule Table Styles */
.schedule-table,
.holiday-table {
    margin: 20px 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.schedule-row,
.holiday-row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
}

.schedule-row:last-child,
.holiday-row:last-child {
    border-bottom: none;
}

.schedule-row.header,
.holiday-row.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.schedule-day,
.holiday-name {
    flex: 1;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    font-weight: 500;
    min-width: 120px;
}

.schedule-row.header .schedule-day,
.holiday-row.header .holiday-name {
    background: transparent;
}

.schedule-petitioner,
.schedule-respondent,
.holiday-petitioner,
.holiday-respondent {
    flex: 1;
    padding: 8px 10px;
    display: flex;
    align-items: center;
}

.schedule-petitioner input,
.schedule-respondent input,
.holiday-petitioner select,
.holiday-respondent select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.schedule-petitioner input:focus,
.schedule-respondent input:focus,
.holiday-petitioner select:focus,
.holiday-respondent select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Child Item Styles */
.child-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.child-item h4 {
    margin-top: 0;
    color: #667eea;
}

/* Responsive Schedule Tables */
@media (max-width: 768px) {
    .schedule-row,
    .holiday-row {
        flex-direction: column;
    }

    .schedule-day,
    .holiday-name {
        background: #667eea;
        color: white;
        font-weight: 600;
    }

    .schedule-petitioner,
    .schedule-respondent,
    .holiday-petitioner,
    .holiday-respondent {
        padding: 10px 15px;
    }

    .schedule-petitioner::before,
    .holiday-petitioner::before {
        content: "Petitioner: ";
        font-weight: 500;
        margin-right: 10px;
        min-width: 80px;
    }

    .schedule-respondent::before,
    .holiday-respondent::before {
        content: "Respondent: ";
        font-weight: 500;
        margin-right: 10px;
        min-width: 80px;
    }
}
