* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    padding: 1rem;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
}

.disclaimer {
    text-align: center;
    font-style: italic;
    color: #e74c3c;
    margin-bottom: 2rem;
}

form fieldset {
    border: 1px solid #e0e0e0;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

form legend {
    font-weight: 600;
    font-size: 1.2rem;
    color: #34495e;
    padding: 0 10px;
    margin-left: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.address-row {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.street-field, .city-field { flex: 3; }
.number-field, .state-field { flex: 1; }

label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    color: #555;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

@media (min-width: 768px) {
    body { padding: 2rem; }
    .container { padding: 2.5rem; }
    h1 { font-size: 1.8rem; }
    .form-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .address-row { flex-direction: row; gap: 1rem; }
}

.dynamic-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #e0e0e0;
}

.dynamic-section h4, .dynamic-section h5 {
    margin-bottom: 1rem;
    color: #2c3e50;
    grid-column: 1 / -1; 
}

.child-entry {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.child-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.add-btn {
    background-color: #2ecc71;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.remove-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s;
}
.remove-btn:hover {
    background-color: #c0392b;
}

.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

.file-input-hidden { width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; position: absolute; z-index: -1; }
.file-input-label { background-color: #3498db; color: white; padding: 0.75rem 1rem; border-radius: 5px; cursor: pointer; display: inline-block; text-align: center; font-weight: 500; margin-top: 0.5rem; transition: background-color 0.2s; border: 2px solid transparent; }
.file-input-label:hover { background-color: #2980b9; }
.file-list { margin-top: 0.75rem; }
.file-item { display: flex; justify-content: space-between; align-items: center; background-color: #ecf0f1; padding: 0.5rem 0.75rem; border-radius: 5px; margin-bottom: 0.5rem; font-size: 0.9rem; }
.file-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 1rem; }
.file-remove-btn { background: none; border: none; color: #c0392b; cursor: pointer; font-weight: bold; font-size: 1rem; }

button {
    background: linear-gradient(90deg, #3498db, #2980b9);
    color: #fff;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
}
button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}
button:disabled { background: #bdc3c7; cursor: not-allowed; }
.hidden { display: none; }
#statusMessage { padding: 1rem; margin-bottom: 1.5rem; border-radius: 8px; text-align: center; font-weight: 500; }
#statusMessage.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#statusMessage.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
#successScreen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 400px; }
#successScreen.hidden { display: none; }
#successScreen h2 { font-size: 2rem; color: #27ae60; margin-bottom: 1rem; }
#successScreen p { font-size: 1.1rem; margin-bottom: 2rem; }

