#form_body {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

#form_body h2 {
    color: #2d3748;
    font-size: 1.8rem;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

#form_body h2:first-child {
    margin-top: 0;
}

#form_body h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.entry {
    margin-bottom: 25px;
    position: relative;
}

.entry label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input_container {
    position: relative;
    display: block;
}

.entry input,
.entry textarea {
    width: 100%;
    padding: 14px 16px;
    padding-right: 45px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #2d3748;
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.entry input:invalid:not(:focus):not(:placeholder-shown),
.entry textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #fc8181;
    background-color: rgba(252, 129, 129, 0.05);
}

/*
  IMPORTANT UX RULE:
  - Optional fields should NOT show the “success/green” state.
  - Green state is shown only for REQUIRED fields when they are valid.
*/
.entry input:required:valid:not(:placeholder-shown),
.entry textarea:required:valid:not(:placeholder-shown) {
    border-color: #48bb78;
    background-color: rgba(72, 187, 120, 0.05);
}

.entry input.phone-input:invalid {
    border-color: #fc8181;
    background-color: rgba(252, 129, 129, 0.05);
}

.entry input.phone-input:required:valid:not(:placeholder-shown) {
    border-color: #48bb78;
    background-color: rgba(72, 187, 120, 0.05);
}

.entry input.phone-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.entry input:focus,
.entry textarea:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.entry input:required:focus:placeholder-shown,
.entry textarea:required:focus:placeholder-shown {
    border-color: #667eea;
    background: white;
}

.entry input::placeholder,
.entry textarea::placeholder {
    color: #a0aec0;
}

.entry textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.entry input[type="date"] {
    padding-right: 70px;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.validation-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.entry input:invalid:not(:focus):not(:placeholder-shown) ~ .validation-icon::after,
.entry textarea:invalid:not(:focus):not(:placeholder-shown) ~ .validation-icon::after {
    content: "✖";
    color: #f56565;
    font-size: 16px;
}

.entry input:required:valid:not(:placeholder-shown) ~ .validation-icon::after,
.entry textarea:required:valid:not(:placeholder-shown) ~ .validation-icon::after {
    content: "✓";
    color: #48bb78;
    font-size: 16px;
    font-weight: bold;
}

.entry input.phone-input:invalid ~ .validation-icon::after {
    content: "✖";
    color: #f56565;
    font-size: 16px;
}

.entry input.phone-input:required:valid:not(:placeholder-shown) ~ .validation-icon::after {
    content: "✓";
    color: #48bb78;
    font-size: 16px;
    font-weight: bold;
}

.validation-icon.date-icon {
    right: 45px !important;
}

.entry input[type="date"]::-webkit-calendar-picker-indicator,
.pet_content input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    opacity: 0.7;
    cursor: pointer;
    z-index: 1;
}

.entry input[type="date"]::-webkit-calendar-picker-indicator:hover,
.pet_content input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.3s ease;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #e2e8f0;
    min-width: 120px;
    position: relative;
    height: auto;
    box-sizing: border-box;
    white-space: nowrap;
}

.radio-option:hover {
    background: rgba(102, 126, 234, 0.08);
    border-color: #667eea;
}

.radio-option input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    display: block;
}

.radio-label {
    font-size: 0.95rem;
    color: #4a5568;
    font-weight: 500;
    line-height: 1.2;
    display: inline-block;
    vertical-align: middle;
}

.pet_entry {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.pet_entry:hover {
    border-color: #cbd5e0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.pet_header {
    padding: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-bottom: 1px solid #e2e8f0;
}

.pet_header_content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    min-height: 60px;
}

.pet_top_label {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-grow: 1;
    padding-right: 20px;
}

.pet_controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.arrow_down {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.arrow_down:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

.arrow_down svg {
    width: 20px;
    height: 20px;
    color: #667eea;
    transition: transform 0.3s ease;
}

.trashcan {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(252, 129, 129, 0.1);
    transition: all 0.3s ease;
}

.trashcan:hover {
    background: rgba(252, 129, 129, 0.2);
    transform: scale(1.1);
}

.trashcan svg {
    width: 18px;
    height: 18px;
    color: #fc8181;
}

.trashcan:hover svg {
    color: #f56565;
}

.pet_content {
    padding: 25px;
    transition: all 0.3s ease;
}

.pet_content.collapsed {
    display: none;
}

.pet_content .entry {
    margin-bottom: 20px;
}

.pet_content .entry label {
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.pet_content .input_container {
    position: relative;
}

.pet_content input,
.pet_content textarea {
    width: 100%;
    padding: 12px 14px;
    padding-right: 45px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #2d3748;
    background: white;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.pet_content input:invalid:not(:focus):not(:placeholder-shown),
.pet_content textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #fc8181;
    background-color: rgba(252, 129, 129, 0.05);
}

.pet_content input:required:valid:not(:placeholder-shown),
.pet_content textarea:required:valid:not(:placeholder-shown) {
    border-color: #48bb78;
    background-color: rgba(72, 187, 120, 0.05);
}

.pet_content input:focus,
.pet_content textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pet_content input:required:focus:placeholder-shown,
.pet_content textarea:required:focus:placeholder-shown {
    border-color: #667eea;
    background: white;
}

.pet_content input[type="date"] {
    padding-right: 70px;
    min-height: 44px;
}

.pet_content input[type="date"] ~ .validation-icon.date-icon {
    right: 45px !important;
}

#add_pet_button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 30px auto;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

#add_pet_button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

#add_pet_button:active {
    transform: translateY(-1px);
}

#add_pet_button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#add_pet_button:hover::before {
    left: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pet_entry {
    animation: fadeIn 0.4s ease-out;
}

.section-description {
    color: #718096;
    font-size: 0.95rem;
    margin: -10px 0 25px 0;
    font-style: italic;
}

@media (max-width: 768px) {
    #form_body {
        padding: 15px;
        border-radius: 15px;
    }

    #form_body h2 {
        font-size: 1.5rem;
    }

    .pet_header_content {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .pet_top_label {
        padding-right: 0;
        width: 100%;
    }

    .pet_controls {
        width: 100%;
        justify-content: flex-end;
    }

    .radio-group {
        gap: 15px;
    }

    .radio-option {
        padding: 8px 12px;
        min-width: 100px;
        font-size: 0.9rem;
    }

    .radio-custom {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }

    .radio-custom::after {
        width: 6px;
        height: 6px;
    }

    .pet_content {
        padding: 20px;
    }

    .arrow_down,
    .trashcan {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .radio-option {
        width: 100%;
        justify-content: flex-start;
    }

    .pet_header_content {
        padding: 12px 15px;
    }

    .pet_content {
        padding: 15px;
    }

    .pet_controls {
        gap: 10px;
    }

    .arrow_down,
    .trashcan {
        width: 30px;
        height: 30px;
    }

    #add_pet_button {
        padding: 14px 24px;
        font-size: 0.95rem;
    }
}