﻿.form-wrap {
    padding: 80px 70px 50px;
    position: relative;
}

.form-group {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 32px;
    gap: 20px;
    position: relative;
}

    .form-group:has(.form-group) {
        margin-bottom: 0;
    }
    /* 包含嵌套宽度均分 */
    .form-group > .input-wrap,
    .form-group > .form-group {
        flex: 1;
        min-width: 0;
    }
        /* 只有一个input-wrap时独占宽度 */
        .form-group > .input-wrap:only-child {
            flex: 0 0 100%;
        }
.input-wrap {
    position: relative;
}

textarea {
    resize: vertical;
}

input[type="checkbox"] {
    margin-right: 6px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

input[type="text"], textarea {
    width: 100%;
    padding: 20px 15px 5px;
    border: 1px solid #eaedf3;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fefefe;
    outline: none;
    box-shadow: rgba(0,0,0,0.03) 0 0 20px;
}

    input:focus, textarea:focus {
        border-color: #3498db;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    }

    input.error, textarea.error {
        border-color: #e74c3c;
        background: #fff9f9;
    }

        input.error:focus, textarea.error:focus {
            box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
        }

    textarea + label,
    input[type="text"] + label {
        position: absolute;
        top: 50%;
        left: 15px;
        color: #42454b;
        font-size: 15px;
        font-weight: bold;
        pointer-events: none;
        transform: translateY(-50%);
        transition: all 0.2s ease;
    }

    textarea + label {
        top: 28px;
    }

    input[type="text"]:focus + label,
    input[type="text"]:not(:placeholder-shown) + label,
    textarea:focus + label,
    textarea:not(:placeholder-shown) + label {
        top: 6px;
        transform: translateY(0);
        font-size: 12px;
    }

    input:focus + label, textarea:focus + label {
        color: #3498db;
    }

.error + label {
    color: #e74c3c !important;
}

.input-wrap .errmsg {
    display: none;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 3px;
    padding: 0 5px;
    position: absolute;
}

input[type="submit"] {
    background: #3f78e0;
    color: white;
    border: none;
    padding: 12px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.25);
}

    input[type="submit"]:hover {
        background: #2b65cd;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
    }

    input[type="submit"]:active {
        transform: translateY(0);
    }

    input[type="submit"]:disabled {
        background: #95a5a6;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

:required + label::after {
    content: ' *';
}

.required:after {
    content: " *";
    color: #e74c3c;
}

.required-note {
    color: #7f8c8d;
    font-size: 14px;
    flex: 1;
    margin: 10px 5px;
}

.validation-rules {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
}

    .validation-rules h3 {
        color: #2c3e50;
        margin-bottom: 10px;
    }

    .validation-rules ul {
        padding-left: 20px;
        color: #7f8c8d;
    }

    .validation-rules li {
        margin-bottom: 8px;
        line-height: 1.5;
    }

    .validation-rules strong {
        color: #2c3e50;
    }

.success-message {
    display: none;
    background: #2ecc71;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

    .success-message i {
        font-size: 2rem;
        margin-bottom: 15px;
    }
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    .input-wrap {
        flex: 1 1 100%;
    }

    .submit-group {
        flex-direction: column;
        align-items: stretch;
    }

    input[type="submit"] {
        max-width: 100%;
    }
}

textarea::placeholder,
input::placeholder {
    opacity: 0;
}

textarea:focus::placeholder,
input:focus::placeholder {
    opacity: 1;
}
