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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #1a365d;
    margin-bottom: 5px;
    font-size: 1.6rem;
}

h2 {
    text-align: center;
    color: #4a5568;
    font-weight: 400;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.guide-banner {
    text-align: center;
    margin-bottom: 20px;
}

.guide-banner a {
    display: inline-block;
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.guide-banner a:hover {
    background: #c6f6d5;
    border-color: #68d391;
}

fieldset {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    font-weight: 600;
    color: #2d3748;
    padding: 0 10px;
    font-size: 1.05rem;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    flex: 1 1 100%;
}

label {
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 4px;
    font-weight: 500;
}

.req {
    color: #e53e3e;
}

input, select, textarea {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

input::placeholder {
    color: #a0aec0;
}

/* Entry blocks (work history, family members) */
.work-entry, .family-entry {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.entry-header h4 {
    color: #2d3748;
    font-size: 0.95rem;
}

/* Buttons */
.btn-add {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px dashed #90cdf4;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.2s;
}

.btn-add:hover {
    background: #bee3f8;
    border-color: #63b3ed;
}

.btn-remove {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #fed7d7;
}

.btn-submit {
    background: #2b6cb0;
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.btn-submit:hover {
    background: #2c5282;
}

.btn-submit:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.form-actions {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 40px;
}

/* Loading spinner */
#loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    color: #4a5568;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #2b6cb0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Date validation */
.date-field.valid {
    border-color: #38a169;
}

.date-field.invalid {
    border-color: #e53e3e;
}

.date-hint {
    font-size: 0.75rem;
    margin-top: 2px;
    min-height: 1em;
}

.date-hint.error {
    color: #e53e3e;
}

.date-hint.ok {
    color: #38a169;
}

/* Responsive */
@media (max-width: 700px) {
    .form-row {
        flex-direction: column;
        gap: 8px;
    }
    .container {
        padding: 10px;
    }
}
