/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #626A59;
    background: #fefefe;
    padding: 20px;
}

.form-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(98, 106, 89, 0.1);
    overflow: hidden;
}

/* Form Header */
.form-header {
    background: #F0F1F5;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #626A59;
    position: relative;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #626A59;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #9AA497;
}

.form-header h1 {
    font-family: 'Playfair Display', 'Times New Roman', Times, serif;
    font-size: 1.8rem;
    color: #626A59;
    margin-bottom: 12px;
}

.form-header p {
    color: #4a5568;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Wedding Intake Form */
.wedding-intake-form {
    padding: 20px;
}

/* Form Sections */
.form-section {
    margin-bottom: 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    background: #626A59;
    color: white;
    padding: 12px 20px;
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section h2 i {
    font-size: 1.2rem;
}

.section-content {
    padding: 20px;
}

/* Field Groups and Rows */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

.field-row .field.full-width {
    grid-column: 1 / -1;
}

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

.field label {
    font-weight: 600;
    color: #626A59;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Input Styles */
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field textarea {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background: white;
    color: #2d3748;
    transition: all 0.3s ease;
    width: 100%;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: #626A59;
    box-shadow: 0 0 0 3px rgba(98, 106, 89, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.field textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'Inter', sans-serif;
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    color: #4a5568;
    transition: color 0.3s ease;
}

.radio-label:hover {
    color: #626A59;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #626A59;
    background: #626A59;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

/* Signature Section */
.signature-section {
    background: #f8f9fa;
    border: 2px solid #626A59;
}

.signature-section h2 {
    background: #626A59;
}

.signature-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.signature-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
}

.signature-box h4 {
    color: #626A59;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #C6CBCA;
    padding-bottom: 10px;
}

.signature-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.signature-line {
    position: relative;
}

.signature-line input {
    border-bottom: 2px solid #626A59 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    padding: 8px 0 !important;
    background: transparent !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 40px 30px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-top: 40px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    min-width: 140px;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: #626A59;
    color: white;
}

.btn-primary:hover {
    background: #9AA497;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(98, 106, 89, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #626A59;
    border: 2px solid #626A59;
}

.btn-secondary:hover {
    background: #626A59;
    color: white;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #626A59;
    border: 2px solid #626A59;
}

.btn-outline:hover {
    background: #626A59;
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .wedding-intake-form {
        padding: 20px;
    }

    .form-header {
        padding: 30px 20px;
    }

    .form-header h1 {
        font-size: 2rem;
    }

    .section-content {
        padding: 20px;
    }

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

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

    .radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .form-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .back-link {
        position: static;
        margin-bottom: 20px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-header h1 {
        font-size: 1.8rem;
    }

    .form-header p {
        font-size: 1rem;
    }

    .form-section h2 {
        font-size: 1.2rem;
        padding: 15px 20px;
    }

    .section-content {
        padding: 15px;
    }

    .signature-box {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .form-header,
    .form-actions,
    .back-link {
        display: none !important;
    }

    /* Remove body padding and set compact font */
    body {
        background: white !important;
        color: black !important;
        font-size: 9pt !important;
        line-height: 1.2 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Compact form container */
    .form-container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .wedding-intake-form {
        padding: 8pt !important;
    }

    /* Compact form sections */
    .form-section {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000 !important;
        border-radius: 0 !important;
        margin-bottom: 12pt !important;
        padding: 0 !important;
    }

    .form-section h2 {
        background: #8B7355 !important;
        color: white !important;
        font-size: 10pt !important;
        padding: 4pt 6pt !important;
        margin: 0 !important;
        font-weight: bold !important;
    }

    .form-section h2 i {
        display: none !important;
    }

    /* Compact section content */
    .section-content {
        padding: 6pt !important;
    }

    /* Compact field groups */
    .field-group {
        margin: 0 !important;
    }

    .field-row {
        display: flex !important;
        gap: 8pt !important;
        margin-bottom: 4pt !important;
        align-items: flex-start !important;
    }

    .field {
        margin-bottom: 4pt !important;
        flex: 1 !important;
    }

    .field.full-width {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Compact labels and inputs */
    .field label {
        font-size: 8pt !important;
        font-weight: bold !important;
        margin-bottom: 1pt !important;
        display: block !important;
        color: #000 !important;
    }

    .field input,
    .field textarea {
        border: none !important;
        border-bottom: 1px solid #000 !important;
        background: transparent !important;
        padding: 1pt 2pt !important;
        font-size: 8pt !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        resize: none !important;
    }

    .field textarea {
        min-height: 20pt !important;
        max-height: 30pt !important;
    }

    /* Radio button styling for print */
    .radio-group {
        display: flex !important;
        gap: 8pt !important;
        flex-wrap: wrap !important;
        margin-top: 2pt !important;
    }

    .radio-label {
        display: flex !important;
        align-items: center !important;
        gap: 2pt !important;
        font-size: 8pt !important;
        margin: 0 !important;
    }

    .radio-custom {
        display: none !important;
    }

    input[type="radio"] {
        width: 8pt !important;
        height: 8pt !important;
        margin: 0 !important;
        border: 1px solid #000 !important;
        background: white !important;
    }

    input[type="radio"]:checked {
        background: #000 !important;
    }

    /* Signature section optimization */
    .signature-section {
        page-break-inside: avoid !important;
        margin-top: 15pt !important;
    }

    .signature-group {
        display: flex !important;
        gap: 15pt !important;
        margin-top: 8pt !important;
    }

    .signature-box {
        flex: 1 !important;
        border: 1px solid #000 !important;
        padding: 6pt !important;
        border-radius: 0 !important;
    }

    .signature-box h4 {
        font-size: 9pt !important;
        font-weight: bold !important;
        margin-bottom: 4pt !important;
        text-align: center !important;
        border-bottom: 1px solid #000 !important;
        padding-bottom: 2pt !important;
    }

    .signature-fields .field-row {
        margin-bottom: 2pt !important;
    }

    .signature-line {
        border-bottom: 1px solid #000 !important;
        min-height: 15pt !important;
        margin-top: 2pt !important;
    }

    .signature-line input {
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        height: 15pt !important;
        padding: 0 !important;
    }

    /* Compact contract intro elements */
    .contract-intro p {
        font-size: 8pt !important;
        line-height: 1.2 !important;
        margin-bottom: 4pt !important;
    }

    .inline-input {
        border: none !important;
        border-bottom: 1px solid #000 !important;
        background: transparent !important;
        font-size: 8pt !important;
        padding: 0 1pt !important;
        width: auto !important;
        min-width: 20pt !important;
    }

    /* Remove focus styles and animations */
    * {
        transition: none !important;
        animation: none !important;
        box-shadow: none !important;
        transform: none !important;
    }

    /* Optimize specific sections for better printing */
    .form-section:nth-child(1), /* Contact Information */
    .form-section:nth-child(2)  /* Event Details */ {
        page-break-after: avoid;
    }

    .form-section:nth-child(n+6) { /* Later sections */
        page-break-before: avoid;
    }

    /* Ensure signature section appears on its own space */
    .signature-section {
        page-break-before: auto !important;
        margin-top: 20pt !important;
    }

    /* Hide placeholder text in print */
    input::placeholder,
    textarea::placeholder {
        color: transparent !important;
    }
}

/* Focus styles for accessibility */
input:focus,
textarea:focus {
    outline: none !important;
}

/* Smooth transitions */
* {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Required field indicator */
.field.required label::after {
    content: ' *';
    color: #e53e3e;
}

/* Form validation styles */
.field.error input,
.field.error textarea {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.field.success input,
.field.success textarea {
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

/* Enhanced visual hierarchy */
.form-section:first-child {
    margin-top: 0;
}

.form-section:last-child {
    margin-bottom: 0;
}

/* Better spacing for long content */
.field-group > .field-row:last-child {
    margin-bottom: 0;
}

/* Improved button group styling */
.form-actions .btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}