@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--text-primary);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.form-container,
.agreement-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.6s ease-out;
}

.section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 2px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--surface);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--secondary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.amount-words {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(79, 70, 229, 0.1));
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    min-height: 45px;
    display: flex;
    align-items: center;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Agreement Styles */
.agreement-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.agreement-content {
    background: transparent;
    color: #000;
}

/* Page Setup */
.agreement-page {
    background: white;
    width: 210mm;
    /* A4 Width */
    min-height: 297mm;
    /* A4 Height */
    padding: 20mm;
    /* Standard Margins */
    margin: 0 auto 20mm auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

/* First Page Bottom Alignment */
.agreement-page.first-page {
    justify-content: flex-end;
    padding-bottom: 40mm;
    /* Extra padding at bottom */
}

.agreement-page h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 1.5rem;
    text-decoration: underline;
    text-transform: uppercase;
}

.agreement-page h2 {
    font-size: 18px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.agreement-page p {
    margin-bottom: 1rem;
    text-align: justify;
    line-height: 1.6;
}

.agreement-page .highlight {
    background-color: #e8f5e9;
    /* Very light green for screen */
    padding: 2px 4px;
    font-weight: 500;
}

.agreement-page ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.agreement-page ol li {
    margin-bottom: 0.5rem;
}

.signature-section {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    page-break-inside: avoid;
}

.signature-block {
    width: 45%;
}

.signature-line {
    margin-top: 2rem;
    border-top: 1px solid #000;
    padding-top: 0.5rem;
    font-size: 13px;
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        background: white;
        padding: 0;
        margin: 0;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .header,
    .form-container,
    .agreement-actions,
    .no-print {
        display: none !important;
    }

    .agreement-container {
        box-shadow: none;
        padding: 0;
        margin: 0;
        background: transparent;
    }

    .agreement-page {
        box-shadow: none;
        margin: 0;
        width: 100%;
        height: 297mm;
        page-break-after: always;
        border: none;
    }

    .agreement-page .highlight {
        background-color: transparent;
        font-weight: 700;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .form-container,
    .agreement-container {
        padding: 1.5rem;
    }

    .section h2 {
        font-size: 1.25rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .agreement-content {
        padding: 1.5rem;
        font-size: 12px;
    }
}