.magic-form-container, .magic-form-container * {
    box-sizing: border-box;
}
.magic-form-container {
    max-width: 100%;
    margin: 0;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
.magic-form-header-embedded {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.magic-form-title-embedded {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.35;
    letter-spacing: -0.015em;
}
.magic-form-intro {
    font-size: 0.925rem;
    color: #64748b;
    line-height: 1.6;
    margin-top: 6px;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.magic-form-group {
    margin-bottom: 22px;
}
.magic-form-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.925rem;
    letter-spacing: -0.01em;
}
.magic-form-input, .magic-form-textarea, .magic-form-select, .magic-form-file {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    color: #0f172a;
    line-height: 1.5;
}
.magic-form-input::placeholder, .magic-form-textarea::placeholder {
    color: #94a3b8;
}
.magic-form-input:hover, .magic-form-textarea:hover, .magic-form-select:hover, .magic-form-file:hover {
    border-color: #94a3b8;
}
.magic-form-input:focus, .magic-form-textarea:focus, .magic-form-select:focus, .magic-form-file:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background-color: #ffffff;
}
.magic-form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.825rem;
    color: #64748b;
}
.magic-form-textarea {
    resize: vertical;
    min-height: 110px;
}
.magic-form-submit-group {
    margin-top: 28px;
    margin-bottom: 0;
}
.magic-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #ffffff;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    text-align: center;
}
.magic-form-submit:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
.magic-form-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}
.magic-form-submit:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.magic-form-message {
    margin-top: 20px;
    padding: 14px 18px;
    display: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}
.magic-form-message.success {
    display: block;
    color: #166534;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.magic-form-message.error {
    display: block;
    color: #991b1b;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}
.magic-form-captcha {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: auto !important;
    max-width: 100% !important;
}
.magic-captcha-img {
    vertical-align: middle;
    cursor: pointer;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    height: 44px;
    flex-shrink: 0 !important;
    transition: all 0.2s ease;
}
.magic-captcha-img:hover {
    border-color: #3b82f6;
    opacity: 0.9;
}
.magic-captcha-input {
    width: 140px !important;
    min-width: 120px !important;
    max-width: 160px !important;
    flex: 0 0 140px !important;
}
.required {
    color: #ef4444;
    margin-left: 4px;
    font-weight: bold;
}

/* Upload Dropzone Styling */
.magic-upload-zone {
    position: relative;
    width: 100%;
}
.magic-form-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.magic-upload-label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}
.magic-upload-label:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: translateY(-1px);
}
.magic-form-file-hidden:focus + .magic-upload-label {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background-color: #eff6ff;
}
.magic-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: #ffffff;
    color: #3b82f6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.magic-upload-label:hover .magic-upload-icon {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}
.magic-upload-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}
.magic-upload-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: #1e293b;
}
.magic-upload-file-name {
    font-size: 0.825rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}
.magic-upload-file-name.has-file {
    color: #2563eb;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .magic-form-container {
        padding: 16px;
    }
    .magic-form-captcha {
        flex-direction: row;
        align-items: center;
    }
    .magic-captcha-input {
        flex: 1 !important;
        width: 100% !important;
    }
    .magic-form-submit {
        width: 100%;
    }
    .magic-upload-label {
        padding: 12px 14px;
        gap: 10px;
    }
    .magic-upload-icon {
        width: 38px;
        height: 38px;
    }
}

/* Login notice styles */
.magic-form-login-notice {
    padding: 32px 20px;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.magic-form-login-icon {
    width: 64px;
    height: 64px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.magic-form-login-text {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 500;
    margin-bottom: 20px;
}
.magic-form-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background-color: #2563eb;
    color: #ffffff !important;
    font-size: 0.925rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
}
.magic-form-login-btn:hover {
    background-color: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}




